-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Running ./x.py test miri --stage 0
twice rebuilds miri, cargo-miri, and rustdoc
#123177
Comments
Building rustdoc using the stage 1 compiler causes this, which is weird. I suspect that previously invoked miri related steps may have broken the cache somehow. Or we may need to improve/enhance |
I've just found this in the rustdoc sources: rust/src/bootstrap/src/core/build_steps/tool.rs Lines 441 to 445 in 7bdd63d
Maybe Miri should do something similar. Then |
That would work actually, it seems to be the right path. |
Unfortunately it doesn't help. We probably still should do it. But somehow building rustdoc seems to delete the build cache for Miri and cargo-miri, and vice versa. |
Cargo has this to say about why things are rebuilt:
And indeed, rustdoc sets
That's a bit annoying to have this set in the tool, it means each tool needs to repeat the same logic. |
iirc rustdoc sets that to not dirt the compiler builds, we should probably handle that more globally. |
Yup, that's what the last commit in #123192 does now. |
…-ozkan Refactor the way bootstrap invokes `cargo miri` Instead of basically doing `cargo run --manifest-path=<cargo-miri's manifest> -- miri`, let's invoke the `cargo-miri` binary directly. That means less indirections, and also makes it easier to e.g. run the libcore test suite in Miri. (But there are still other issues with that.) Also also adjusted Miri's stage numbering so that it is consistent with rustc/rustdoc. This also makes `./x.py test miri` honor `--no-doc`. And this fixes rust-lang#123177 by moving where we handle parallel_compiler.
…-ozkan Refactor the way bootstrap invokes `cargo miri` Instead of basically doing `cargo run --manifest-path=<cargo-miri's manifest> -- miri`, let's invoke the `cargo-miri` binary directly. That means less indirections, and also makes it easier to e.g. run the libcore test suite in Miri. (But there are still other issues with that.) Also also adjusted Miri's stage numbering so that it is consistent with rustc/rustdoc. This also makes `./x.py test miri` honor `--no-doc`. And this fixes rust-lang#123177 by moving where we handle parallel_compiler.
Refactor the way bootstrap invokes `cargo miri` Instead of basically doing `cargo run --manifest-path=<cargo-miri's manifest> -- miri`, let's invoke the `cargo-miri` binary directly. That means less indirections, and also makes it easier to e.g. run the libcore test suite in Miri. (But there are still other issues with that.) Also also adjusted Miri's stage numbering so that it is consistent with rustc/rustdoc. This also makes `./x.py test miri` honor `--no-doc`. And this fixes rust-lang/rust#123177 by moving where we handle parallel_compiler.
Refactor the way bootstrap invokes `cargo miri` Instead of basically doing `cargo run --manifest-path=<cargo-miri's manifest> -- miri`, let's invoke the `cargo-miri` binary directly. That means less indirections, and also makes it easier to e.g. run the libcore test suite in Miri. (But there are still other issues with that.) Also also adjusted Miri's stage numbering so that it is consistent with rustc/rustdoc. This also makes `./x.py test miri` honor `--no-doc`. And this fixes rust-lang/rust#123177 by moving where we handle parallel_compiler.
Refactor the way bootstrap invokes `cargo miri` Instead of basically doing `cargo run --manifest-path=<cargo-miri's manifest> -- miri`, let's invoke the `cargo-miri` binary directly. That means less indirections, and also makes it easier to e.g. run the libcore test suite in Miri. (But there are still other issues with that.) Also also adjusted Miri's stage numbering so that it is consistent with rustc/rustdoc. This also makes `./x.py test miri` honor `--no-doc`. And this fixes rust-lang/rust#123177 by moving where we handle parallel_compiler.
This issue is back now, I am again seeing rebuilds of Miri and rustdoc all the time. Did something change in bootstrap? |
Couldn't reproduce it on my side with default config (without the $ ./x build rustdoc
Building bootstrap
Finished `dev` profile [unoptimized] target(s) in 0.03s
WARNING: you have not made a `config.toml`
HELP: consider running `./x.py setup` or copying `config.example.toml` by running `cp config.example.toml config.toml`
Building stage0 library artifacts (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized] target(s) in 0.10s
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Finished `release` profile [optimized] target(s) in 0.17s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage0 tool lld-wrapper (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized] target(s) in 0.09s
Building tool rustdoc (stage0 -> stage1, x86_64-unknown-linux-gnu)
Finished `release` profile [optimized] target(s) in 0.11s
WARNING: you have not made a `config.toml`
HELP: consider running `./x.py setup` or copying `config.example.toml` by running `cp config.example.toml config.toml`
NOTE: this message was printed twice to make it more likely to be seen
Build completed successfully in 0:00:02
$ git log -1
commit 164e1297e1bce47a241e4d93a9f044452b288715 (HEAD -> master, origin/master, origin/HEAD)
Merge: fc555cd832e 45da03541c0
Author: bors <[email protected]>
Date: Tue Jun 25 05:09:30 2024 +0000
Auto merge of #125610 - oli-obk:define_opaque_types14, r=compiler-errors
Allow constraining opaque types during various unsizing casts
allows unsizing of tuples, arrays and Adts to constraint opaque types in their generic parameters to concrete types on either side of the unsizing cast.
Also allows constraining opaque types during trait object casts that only differ in auto traits or lifetimes.
cc #116652 There might be a specific option that triggers this. Can you share your config? |
Seems like it only happens with |
The command I was running is |
Found the problem and opened the fix PR. I will try to add a bootstrap test (around this weekend) for ensuring this never happens again. |
Thanks for the quick debugging :) |
…obzol fix broken build cache caused by rustdoc builds Currently rustdoc breaks the build cache (due to having different rustflags) when building rustdoc before building another tool (e.g., `x test miri && x test rustdoc && x test miri`). This change fixes that by moving `on-broken-pipe` into `prepare_cargo_tool` so it is set for all tools. cc `@RalfJung` Fixes rust-lang#123177
This is fairly easy to reproduce:
(The
--test-args
just serves to make this take less long.)The second command shouldn't have to build anything, just run the tests. But somehow it actually rebuilds miri, cargo-miri, and rustdoc.
This is a recent regression introduced by #123028. Somehow building rustdoc seems to destroy the build cache for miri and cargo-miri, and vice versa.
Cc @onur-ozkan
The text was updated successfully, but these errors were encountered: