-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo recompiling all dependencies when building for aarch64-apple-ios-sim #11553
Comments
I am sorry to hear you bumping into this. However, due to lack of a minimal set of steps to reproduce, and not providing any version and environment information, it's hard to examinate and proceed. There is an FAQ section for checking how a recompile happened. It might be helpful. |
I am sorry for a poor problem description. At first I was mistaking about the problem origin and about what was happening. Now I have a minimal reproducible example:
Cargo will recompile all the dependencies even tho nothing has changed. Versions:
|
Sorry. I had a hard time reproducing. Here are the logs from me. click to expand$ cargo +stable build --target aarch64-apple-ios-sim -v
Updating crates.io index
Compiling libc v0.2.139
Compiling cfg-if v1.0.0
Compiling ppv-lite86 v0.2.17
Running `rustc --crate-name build_script_build /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/libc-0.2.139/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=84386ee5c872ee15 -C extra-filename=-84386ee5c872ee15 --out-dir /home/user/cargo-bug-min-repr-example/target/debug/build/libc-84386ee5c872ee15 -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --cap-lints allow`
Running `rustc --crate-name cfg_if --edition=2018 /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cfg-if-1.0.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=032a5d4f76cf6059 -C extra-filename=-032a5d4f76cf6059 --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --cap-lints allow`
Running `rustc --crate-name ppv_lite86 --edition=2018 /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ppv-lite86-0.2.17/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="simd"' --cfg 'feature="std"' -C metadata=0ca58dd0a1af9b31 -C extra-filename=-0ca58dd0a1af9b31 --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --cap-lints allow`
Running `/home/user/cargo-bug-min-repr-example/target/debug/build/libc-84386ee5c872ee15/build-script-build`
Running `rustc --crate-name libc /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/libc-0.2.139/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=0016f68fe78a65bf -C extra-filename=-0016f68fe78a65bf --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --cap-lints allow --cfg freebsd11 --cfg libc_priv_mod_use --cfg libc_union --cfg libc_const_size_of --cfg libc_align --cfg libc_int128 --cfg libc_core_cvoid --cfg libc_packedN --cfg libc_cfg_target_vendor --cfg libc_non_exhaustive --cfg libc_ptr_addr_of --cfg libc_underscore_const_names --cfg libc_const_extern_fn`
Compiling getrandom v0.2.8
Running `rustc --crate-name getrandom --edition=2018 /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/getrandom-0.2.8/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="std"' -C metadata=9089169fb8c5ac01 -C extra-filename=-9089169fb8c5ac01 --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --extern cfg_if=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/libcfg_if-032a5d4f76cf6059.rmeta --extern libc=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/liblibc-0016f68fe78a65bf.rmeta --cap-lints allow`
Compiling rand_core v0.6.4
Running `rustc --crate-name rand_core --edition=2018 /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rand_core-0.6.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="getrandom"' --cfg 'feature="std"' -C metadata=dcde00aaec906106 -C extra-filename=-dcde00aaec906106 --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --extern getrandom=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-i
os-sim/debug/deps/libgetrandom-9089169fb8c5ac01.rmeta --cap-lints allow`
Compiling rand_chacha v0.3.1
Running `rustc --crate-name rand_chacha --edition=2018 /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rand_chacha-0.3.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="std"' -C metadata=c9606b8cc7b4277c -C extra-filename=-c9606b8cc7b4277c --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --extern ppv_lite86=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/libppv_lite86-0ca58dd0a1af9b31.rmeta --extern rand_core=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/librand_core-dcde00aaec906106.rmeta --cap-lints allow`
Compiling rand v0.8.5
Running `rustc --crate-name rand --edition=2018 /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rand-0.8.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="getrandom"' --cfg 'feature="libc"' --cfg 'feature="rand_chacha"' --cfg 'feature="std"' --cfg 'feature="std_rng"' -C metadata=af96ba8195ea34a8 -C extra-filename=-af96ba8195ea34a8 --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --extern libc=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/liblibc-0016f68fe78a65bf.rmeta --extern rand_chacha=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/librand_chacha-c9606b8cc7b4277c.rmeta --extern rand_core=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/librand_core-dcde00aaec906106.rmeta --cap-lints allow`
Compiling mre-bug-ios v0.1.0 (/home/user/cargo-bug-min-repr-example)
Running `rustc --crate-name mre_bug_ios --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=823d07d57f364768 -C extra-filename=-823d07d57f364768 --out-dir /home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps --target aarch64-apple-ios-sim -C incremental=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/incremental -L dependency=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps -L dependency=/home/user/cargo-bug-min-repr-example/target/debug/deps --extern rand=/home/user/cargo-bug-min-repr-example/target/aarch64-apple-ios-sim/debug/deps/librand-af96ba8195ea34a8.rlib`
Finished dev [unoptimized + debuginfo] target(s) in 4.18s
$ cargo +stable check
Compiling libc v0.2.139
Checking cfg-if v1.0.0
Checking ppv-lite86 v0.2.17
Checking getrandom v0.2.8
Checking rand_core v0.6.4
Checking rand_chacha v0.3.1
Checking rand v0.8.5
Checking mre-bug-ios v0.1.0 (/home/user/cargo-bug-min-repr-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.96s
$ cargo +stable build --target aarch64-apple-ios-sim -v
Fresh cfg-if v1.0.0
Fresh ppv-lite86 v0.2.17
Fresh libc v0.2.139
Fresh getrandom v0.2.8
Fresh rand_core v0.6.4
Fresh rand_chacha v0.3.1
Fresh rand v0.8.5
Fresh mre-bug-ios v0.1.0 (/home/user/cargo-bug-min-repr-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.06s --verbose flag would be better. In combination, it may look like:
CARGO_LOG=cargo::core::compiler::fingerprint=info cargo build --target aarch64-apple-ios-sim BTW, the |
You could also try the current nightly Cargo with |
That's interesting, thank you for the ideas, I will try to investigate what's happening out there. There is nothing special about my filesystem. The logs during the second build tell that the |
Problem
If you try to make a
cargo build --target aarch64-apple-ios-sim
orcargo build --target aarch64-apple-ios
, then make a subtle change in the code, then rebuild it, cargo recompiles all the dependencies from scratch as you were doingcargo clean
.Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: