-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Don't display bootstrap changelog warnings in --dry-run mode #138078
Conversation
The current PR still makes us see the note twice - once for normal run, and once more for dry run, but that's not a big deal. One alternative approach is to unify the location of --- a/src/bootstrap/src/bin/main.rs
+++ b/src/bootstrap/src/bin/main.rs
@@ -151,7 +151,10 @@ fn check_version(config: &Config) -> Option<String> {
let mut msg = String::new();
let latest_change_id = CONFIG_CHANGE_HISTORY.last().unwrap().change_id;
- let warned_id_path = config.out.join("bootstrap").join(".last-warned-change-id");
+ // If we are in dry-run mode, try and recover the original config.out
+ // (i.e. the one without "tmp-dry-run" appended)
+ let base_path = if config.dry_run() { config.out.parent().unwrap() } else { config.out };
+ let warned_id_path = base_path.join("bootstrap").join(".last-warned-change-id");
if let Some(mut id) = config.change_id {
if id == latest_change_id { but that looks extremely hacky, and probably not worth the gains. |
Can't we just put an if condition around the print to avoid printing it in dry run mode altogether? Seems like that would be the easiest :) |
Great idea, actually! Done. |
r? Kobzol (since you're looking at it already) |
Thanks! You might want to modify the PR title and description. @bors r+ rollup |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
…mpiler-errors Rollup of 17 pull requests Successful merges: - rust-lang#137827 (Add timestamp to unstable feature usage metrics) - rust-lang#138041 (bootstrap and compiletest: Use `size_of_val` from the prelude instead of imported) - rust-lang#138046 (trim channel value in `get_closest_merge_commit`) - rust-lang#138053 (Increase the max. custom try jobs requested to `20`) - rust-lang#138061 (triagebot: add a `compiler_leads` ad-hoc group) - rust-lang#138064 (Remove - from xtensa targets cpu names) - rust-lang#138075 (Use final path segment for diagnostic) - rust-lang#138078 (Reduce the noise of bootstrap changelog warnings in --dry-run mode) - rust-lang#138081 (Move `yield` expressions behind their own feature gate) - rust-lang#138090 (`librustdoc`: flatten nested ifs) - rust-lang#138092 (Re-add `DynSend` and `DynSync` impls for `TyCtxt`) - rust-lang#138094 (a small borrowck cleanup) - rust-lang#138098 (Stabilize feature `const_copy_from_slice`) - rust-lang#138103 (Git ignore citool's target directory) - rust-lang#138105 (Fix broken link to Miri intrinsics in documentation) - rust-lang#138108 (Mention me (WaffleLapkin) when changes to `rustc_codegen_ssa` occur) - rust-lang#138117 ([llvm/PassWrapper] use `size_t` when building arg strings) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138078 - moxian:rember-warns, r=Kobzol Reduce the noise of bootstrap changelog warnings in --dry-run mode Presently x.py displays "There have been changes to x.py since you last updated:" note only once when run normally, but on every invocation when run with `--dry-run`. The disparity is not exactly intentonal, but just a historical accident. It was made to be printed once in rust-lang#117815 via storing `.last-warned-change-id` on disk in `{config.out}/bootstrap` (i.e. `build/bootstrap`) directory. But that didn't quite work for `--dry-run`, since `{config.out}/bootsrap` points to `build/tmp-dry-run/bootstrap` which *isn't* created in dry-run mode, so file creation fails. This got fixed in rust-lang#118789 and now `--dry-run` does not save `.last-warned-change-id` at all. (Nor does it read it, since it cannot know to read from non-dry-run location) This PR simply stops displaying the changelog altogether in --dry-run mode. <details> <summary>previous attempt (outdated)</summary> This PR takes a different approach, and instead of not-writing the stamp in `--dry-run` mode it instead tries harder to yes-write it, and, specifically, creates `build/tmp-dry-run/bootstrap` directory to do so. If neccessary (i.e. if there are changes newer than the `change-id` stamp of config.toml to warn about). Note that `build/tmp-dry-run/` was *already* being created, so making an extra `boostrap` sub-folder should not meaningfully pollute the build dir. </details> (Apologies for the, perhaps, excessively wordy PR, I'm new to this)
Presently x.py displays "There have been changes to x.py since you last updated:" note only once when run normally, but on every invocation when run with
--dry-run
.The disparity is not exactly intentonal, but just a historical accident.
It was made to be printed once in #117815 via storing
.last-warned-change-id
on disk in{config.out}/bootstrap
(i.e.build/bootstrap
) directory.But that didn't quite work for
--dry-run
, since{config.out}/bootsrap
points tobuild/tmp-dry-run/bootstrap
which isn't created in dry-run mode, so file creation fails.This got fixed in #118789 and now
--dry-run
does not save.last-warned-change-id
at all. (Nor does it read it, since it cannot know to read from non-dry-run location)This PR simply stops displaying the changelog altogether in --dry-run mode.
previous attempt (outdated)
This PR takes a different approach, and instead of not-writing the stamp in `--dry-run` mode it instead tries harder to yes-write it, and, specifically, creates `build/tmp-dry-run/bootstrap` directory to do so. If neccessary (i.e. if there are changes newer than the `change-id` stamp of config.toml to warn about). Note that `build/tmp-dry-run/` was *already* being created, so making an extra `boostrap` sub-folder should not meaningfully pollute the build dir.(Apologies for the, perhaps, excessively wordy PR, I'm new to this)