-
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
handle ci-rustc incompatible options during config parse #127322
handle ci-rustc incompatible options during config parse #127322
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
This PR modifies If appropriate, please update This PR modifies If appropriate, please update |
Leading spaces in config options cause `configure` script to fail. Signed-off-by: onur-ozkan <[email protected]>
e8412f7
to
d3dce36
Compare
err_incompatible_ci_rustc_option!(optimize_toml, "optimize"); | ||
err_incompatible_ci_rustc_option!(debug_toml, "debug"); | ||
err_incompatible_ci_rustc_option!(codegen_units, "codegen-units"); | ||
err_incompatible_ci_rustc_option!(codegen_units_std, "codegen-units-std"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these really all incompatible? I'd have assumed that you still get to use all of these for a full build (i.e., basically stage 2 build). Those options related to std
definitely feel like they still are fine -- they would certainly apply to the standard library built by the downloaded rustc, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building std from source is not currently allowed with download-rustc:
rust/src/bootstrap/src/core/build_steps/compile.rs
Lines 155 to 171 in 51917ba
// When using `download-rustc`, we already have artifacts for the host available. Don't | |
// recompile them. | |
if builder.download_rustc() && target == builder.build.build | |
// NOTE: the beta compiler may generate different artifacts than the downloaded compiler, so | |
// its artifacts can't be reused. | |
&& compiler.stage != 0 | |
// This check is specific to testing std itself; see `test::Std` for more details. | |
&& !self.force_recompile | |
{ | |
let sysroot = builder.ensure(Sysroot { compiler, force_recompile: false }); | |
cp_rustc_component_to_ci_sysroot( | |
builder, | |
&sysroot, | |
builder.config.ci_rust_std_contents(), | |
); | |
return; | |
} |
But it will eventually be possible with redesign stage 0 std (I will make it possible before landing use precompiled rustc for non-dist builders), so I will remove the std-related options from the list.
d3dce36
to
99336cc
Compare
I got some ideas to improve the current approach. I will work on them later today. @rustbot author |
7527d8d
to
d9a9491
Compare
This change ensures that `config.toml` does not use CI rustc incompatible options when CI rustc is enabled. This is necessary because some options can change compiler's behavior in certain scenarios. The list may not be complete, but should be a good first step as it's better than nothing! Signed-off-by: onur-ozkan <[email protected]>
d9a9491
to
335bdd4
Compare
@rustbot ready |
@bors r+ |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#127083 (Add release notes for 1.80) - rust-lang#127322 (handle ci-rustc incompatible options during config parse) - rust-lang#127697 (use std for file mtime and atime modifications) - rust-lang#127704 (Fix minor typos in std::process doc on Win argv) - rust-lang#127710 (clarify the meaning of the version number for accepted/removed features) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127322 - onur-ozkan:ci-rustc-incompatible-options, r=Mark-Simulacrum handle ci-rustc incompatible options during config parse This PR ensures that `config.toml` does not use CI rustc incompatible options when CI rustc is enabled (just like [ci-llvm checks](https://github.com/rust-lang/rust/blob/e2cf31a6148725bde4ea48acf1e4fe72675257a2/src/bootstrap/src/core/config/config.rs#L1809-L1836)). Some options can change compiler's behavior in certain scenarios. If we don't check these incompatible options, CI runners using CI rustc might ignore options we have explicitly set. This could be dangerous as we might think a rustc test passed with option T but in fact it wasn't tested with option T. Later in rust-lang#122709, I will disable CI rustc if any of those options were used (similar to [this approach](https://github.com/rust-lang/rust/blob/dd2c24aafddbd9cc170f32f5b447c7d3005c7412/src/ci/run.sh#L165-L169)). If CI runners fail because of these checks, it means the logic in run.sh isn't covering the incompatible options correctly (since any incompatible option should turn off CI rustc). The list may not be complete, but should be a good first step as it's better than nothing! Blocker for rust-lang#122709
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
Rollup merge of rust-lang#127974 - onur-ozkan:force-std-builds, r=Mark-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
This PR ensures that
config.toml
does not use CI rustc incompatible options when CI rustc is enabled (just like ci-llvm checks). Some options can change compiler's behavior in certain scenarios. If we don't check these incompatible options, CI runners using CI rustc might ignore options we have explicitly set. This could be dangerous as we might think a rustc test passed with option T but in fact it wasn't tested with option T.Later in #122709, I will disable CI rustc if any of those options were used (similar to this approach). If CI runners fail because of these checks, it means the logic in run.sh isn't covering the incompatible options correctly (since any incompatible option should turn off CI rustc).
The list may not be complete, but should be a good first step as it's better than nothing!
Blocker for #122709