-
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
Bootstrap: llvm-bitcode-linker
adds unnecessary recompilation
#122491
Comments
cc @kjetilkjeka |
Oh, that's not good. Thanks for reporting. I will look at it tomorrow. |
I have tracked it down to this rust/src/bootstrap/src/core/build_steps/compile.rs Lines 1847 to 1855 in ee03c28
From the documentation of ensure it say
Also the definition of |
The stuff above seems to work fine as building the The problem seems to be that |
I now know what the problem is. I will need some help to figure out the correct way to solve it. The problem
rust/src/bootstrap/src/core/build_steps/tool.rs Lines 483 to 485 in accc516
This causes common dependencies between the LLVM bitcode linker and Rustdoc to be rebuilt when one is called after the other. Since Rustdoc builds the bitcode linker (presumably through the The questions I need resolved to fix itIs it correct/ethical of rustdoc to set If it is important for rustdoc to use its own set of rustflags, should it then use a different build directory to other tools/steps using cargo? |
I see that @m-ou-se added this in c7f443a6e3320b4cb70da5af08810f1dd60e146c. Maybe she knows more about this? |
We can't have same set of rustflags for every |
That seems to work well in the scenario described above and in other scenarios I tested for. I think I just imagined that this was more frequently occurring problem if all tools share build folder and are able to set rustflags separately and adding this to Anyway, as this at least is fixing the apparent issue I'm creating a MR with this solution now |
…_trigger_rebuild, r=onur-ozkan LLVM bitcode linker: use --cfg=parallel_compiler to avoid invalidating the build cache of rustdoc fixes rust-lang#122491 `@rustbot` ready
…rigger_rebuild, r=onur-ozkan LLVM bitcode linker: use --cfg=parallel_compiler to avoid invalidating the build cache of rustdoc fixes rust-lang#122491 `@rustbot` ready
…t, r=onur-ozkan Disable `llvm-bitcode-linker` in the default bootstrap profiles I don't think that we really need to enable `llvm-bitcode-linker` in the default bootstrap profiles, since it seems that it is only useful for running `nvptx` tests. It should be enabled on CI, which it is, and that should be enough. People can enable it easily locally, if they want. The linker causes occasionally some rebuild issues (rust-lang#122491, rust-lang#126464), but more importantly it is just needless work to build it locally. I kept it enabled for `dist`, because it is distributed as a `rustup` component (for some reason it's not included in `extended`? not sure). Fixes: rust-lang#126464
…-ozkan Disable `llvm-bitcode-linker` in the default bootstrap profiles I don't think that we really need to enable `llvm-bitcode-linker` in the default bootstrap profiles, since it seems that it is only useful for running `nvptx` tests. It should be enabled on CI, which it is, and that should be enough. People can enable it easily locally, if they want. The linker causes occasionally some rebuild issues (rust-lang/rust#122491, rust-lang/rust#126464), but more importantly it is just needless work to build it locally. I kept it enabled for `dist`, because it is distributed as a `rustup` component (for some reason it's not included in `extended`? not sure). Fixes: rust-lang/rust#126464
The
llvm-bitcode-linker
, which is enabled by default in thecompiler
config, is recompiled everytime I try to run tests:The recompilation also causes further recompilation of
rustdoc
(if I disable the bitcode linker, rustdoc is not recompiled).The text was updated successfully, but these errors were encountered: