-
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
Unite bless environment variables under RUSTC_BLESS
#113298
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy The Miri subtree was changed cc @rust-lang/miri |
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.
I would name it RUSTC_BLESS
, if you want a prefix. But then if you work in tool repos like Clippy or MIRI, you'll have to run RUSTC_BLESS=1 cargo test
, which is a bit weird, because the tool is not rustc. I feel the same with just RUST_BLESS
. But maybe that's just me 🤔
e811857
to
c8d0fda
Compare
I did have the same thoughts. Any thoughts on Anyhow I set it to |
RUSTC_BLESS works for me. We anyway invoke this as "./miri bless" (or hopefully soon "./miri test --bless") so users never see the env var.
|
cc @jyn514 as our resident "bootstrap should be consistent dammit" person. |
i think the clippy user experience is more important than making bootstrap's code simpler. bootstrap kind of fundamentally has to workaround quirks in the tools it invokes so i place a fairly low priority on removing the workarounds as long as they're reliable. that said, the inconsistency i see from the user perspective is that bootstrap uses so my preference is probably to close this PR and only change env variables within rust-lang/rust itself to be consistent, not in any subtrees. |
(oh, this just gave me the idea to get rid of TESTNAME and use normal |
We're not married to those env vars, we just added them like 1 week ago. So changing them doesn't cause any harm. And I myself have no objective objections against
That's what MIRI also does. But now in miri the env var is called |
From a user perspective, Miri doesn't use an env var, it uses |
I think at least the portion of this it at sets a commonly usable variable should be fine and needed (at least I use it in #112697). Clippy and Miri could always split off their own variables again if it ever turns out they need finer control - but it seems like there isn’t much objection to trying to use the same one as-is? At least until there is something better than the env solution, which sounds cleaner but also not necessarily close. I’ll make it your call, I can adjust as needed r? @jyn514 |
☔ The latest upstream changes (presumably #112697) made this pull request unmergeable. Please resolve the merge conflicts. |
i don't have time for reviews, sorry r? bootstrap |
AFAIK, |
c8d0fda
to
d29052e
Compare
☔ The latest upstream changes (presumably #113514) made this pull request unmergeable. Please resolve the merge conflicts. |
I don't have a strong opinion on the variable name to use r? bootstrap |
rustfmt now also has an env var for blessing: #114054 |
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.
lgtm, and as you said, we can bikeshed in the future.
needs a rebase and rustfmt taken into the fold
d29052e
to
1dff779
Compare
Some changes occurred in src/tools/cargo cc @ehuss Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
1dff779
to
ae451f9
Compare
Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`.
ae451f9
to
9439e02
Compare
@bors r+ Thanks for the quick and thorough fixes! |
⌛ Testing commit 9439e02 with merge fda2f9d1cf87618de855581b4c56161c69a5ac67... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry windows process failure |
☀️ Test successful - checks-actions |
Finished benchmarking commit (0eb5efc): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 654.227s -> 652.516s (-0.26%) |
Unite bless environment variables under `RUST_BLESS` Currently, Clippy and Miri both use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Rename the variable `MIRI_BLESS` (as used in the Miri subtree) to `RUST_BLESS` - Rename the variable `BLESS` (as used in the Clippy subtree) to `RUST_BLESS` - Move emitting `RUST_BLESS` into `prepare_cargo_test` so it is always available (I need this for a WIP PR) --- I prefer something like `RUST_BLESS` to `BLESS` just for a lower chance of conflict (not super common but other tools [do use `BLESS`](https://grep.app/search?q=%22BLESS%22&case=true&words=true&filter[lang][0]=Text&filter[lang][1]=Rust&filter[lang][2]=Python&filter[lang][3]=C%2B%2B&filter[lang][4]=Markdown&filter[lang][5]=C&filter[lang][6]=JSON)), but I can change it to whatever is preferred. Original discussion: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/BLESS.20env.20var.3A.20rename.20to.20CLIPPY_BLESS r? `@oli-obk` cc `@flip1995`
RUST_BLESS
RUSTC_BLESS
Currently, Clippy and Miri both use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes:
MIRI_BLESS
(as used in the Miri subtree) toRUST_BLESS
BLESS
(as used in the Clippy subtree) toRUST_BLESS
RUST_BLESS
intoprepare_cargo_test
so it is always available (I need this for a WIP PR)I prefer something like
RUST_BLESS
toBLESS
just for a lower chance of conflict (not super common but other tools do useBLESS
), but I can change it to whatever is preferred.Original discussion: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/BLESS.20env.20var.3A.20rename.20to.20CLIPPY_BLESS
r? @oli-obk
cc @flip1995