-
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
Add LLVM skip-rebuild
option to x.py
#67437
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I think the build failed for reasons unrelated to the changes. Could someone with powers retry it for me? |
Shouldn't matter too much, it's just the PR build -- the main PR builder (llvm-7) passed anyway. I will however do r? @Mark-Simulacrum as it's likely I'll be the reviewer here not Niko; I'll try to get to this soon. |
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.
r=me with nits fixed
I don't personally agree with having this option as it seems strictly worse to get spurious LLVM bugs due to not rebuilding it, but since people seem to want it, I'm not opposed either.
config.toml.example
Outdated
# this is `false` then the compiler's LLVM will be rebuilt whenever the built | ||
# version doesn't have the correct hash. If it is `true` then LLVM will never | ||
# be rebuilt. The default value is `false`. | ||
#skip-rebuild = true |
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.
#skip-rebuild = true | |
#skip-rebuild = false |
This should indicate the default value.
src/bootstrap/config.rs
Outdated
@@ -617,6 +621,9 @@ impl Config { | |||
set(&mut config.initial_rustc, build.rustc.map(PathBuf::from)); | |||
set(&mut config.initial_cargo, build.cargo.map(PathBuf::from)); | |||
|
|||
let default = false; | |||
config.llvm_skip_rebuild = llvm_skip_rebuild.unwrap_or(default); |
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.
Please inline default
here. I'm not sure why LLVM asserts below have it pulled out (no need to change that in this PR).
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.
Yeah, I also thought this was a bit odd, but decided to stick to the pattern that was there. Will fix this now. Thanks! 👍
src/bootstrap/native.rs
Outdated
@@ -74,6 +74,11 @@ impl Step for Llvm { | |||
let done_stamp = out_dir.join("llvm-finished-building"); | |||
|
|||
if done_stamp.exists() { | |||
if builder.config.llvm_skip_rebuild { | |||
builder.info("Skipping LLVM rebuild"); |
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.
We should use language similar to --keep-stage
here.
builder.info("Skipping LLVM rebuild"); | |
builder.info("Warning: Using a potentially old LLVM; this may not behave well."); |
@Mark-Simulacrum I think I've addressed your feedback. Let me know if you need anything else. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
r=me with the tidy failure fixed |
@bors r+ |
📌 Commit 522f977 has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
…Mark-Simulacrum Add LLVM `skip-rebuild` option to `x.py` This PR reimplements parts of @Walther's work from rust-lang#65848, and closes rust-lang#65612. I decided not to implement the [arguments to override this setting](rust-lang#65612 (comment)) in this PR. If there's strong feeling that this change shouldn't be merged without the overrides then I'm happy to close this until I've had a chance to add them in. Otherwise I'll aim to submit a second PR with those this weekend. I'd have liked to have tested the change in `native.rs`, but there didn't seem to be any existing test infrastructure. I ran this a few times manually and it _worked on my machine_ though... 😬
@bors r-
Tidy failure in the rollup |
I don't know enough about how rollups work to know why there'd be a tidy issue there and not when I run it locally, but I've reformatted it to match @aidanhs' comment. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Looks like rustfmt wants a comma at the end. You might be able to observe the failure locally by rebasing atop master before running tidy. |
@Mark-Simulacrum Thank you! Should be fixed now. |
@bors r+ |
📌 Commit e44fc45 has been approved by |
…crum Add LLVM `skip-rebuild` option to `x.py` This PR reimplements parts of @Walther's work from #65848, and closes #65612. I decided not to implement the [arguments to override this setting](#65612 (comment)) in this PR. If there's strong feeling that this change shouldn't be merged without the overrides then I'm happy to close this until I've had a chance to add them in. Otherwise I'll aim to submit a second PR with those this weekend. I'd have liked to have tested the change in `native.rs`, but there didn't seem to be any existing test infrastructure. I ran this a few times manually and it _worked on my machine_ though... 😬
☀️ Test successful - checks-azure |
…ion, r=Centril Add `llvm-skip-rebuild` flag to `x.py` This PR follows on from rust-lang#67437 to complete the feature request from rust-lang#65612. Specifically it adds a new command-line flag, `--llvm-skip-rebuild`, which overrides both any value set in `config.toml` and the default value (`false`). I'm not 100% confident that I've implemented the override in the "best" way, but I've checked it locally and it seems to work at least. This option isn't currently mentioned in the Guide to Rustc Development. I'd be happy to write something on it if folk think that's worthwhile.
…ion, r=Centril Add `llvm-skip-rebuild` flag to `x.py` This PR follows on from rust-lang#67437 to complete the feature request from rust-lang#65612. Specifically it adds a new command-line flag, `--llvm-skip-rebuild`, which overrides both any value set in `config.toml` and the default value (`false`). I'm not 100% confident that I've implemented the override in the "best" way, but I've checked it locally and it seems to work at least. This option isn't currently mentioned in the Guide to Rustc Development. I'd be happy to write something on it if folk think that's worthwhile.
This PR reimplements parts of @Walther's work from #65848, and closes #65612.
I decided not to implement the arguments to override this setting in this PR. If there's strong feeling that this change shouldn't be merged without the overrides then I'm happy to close this until I've had a chance to add them in. Otherwise I'll aim to submit a second PR with those this weekend.
I'd have liked to have tested the change in
native.rs
, but there didn't seem to be any existing test infrastructure. I ran this a few times manually and it worked on my machine though... 😬