What could be a possible reason for cargo build
immediately after cargo check
recompiling many (but not all) dependencies?
Cargo.toml
[package]
name = "greeter"
version = "0.1.0"
authors = ["Near Inc <[email protected]>"]
edition = "2018"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
near-sdk = "3.1.0"
[profile.release]
codegen-units = 1
# Tell `rustc` to optimize for small code size.
opt-level = "z"
lto = true
debug = false
panic = "abort"
# Opt into extra safety checks on arithmetic operations https://stackoverflow.com/a/64136471/249801
overflow-checks = true
[workspace]
members = []
cargo check
is not a build. It simply checks that your code would compile, but doesn't necessarily build anything. See here for more information.
So cargo build
will need to actually build some crates, that where not built during cargo check
. Other crates may need to be fully compiled to check (for example crates used in a build.rs
script or by procedural macros), and where therefore already compiled when you ran cargo build
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With