-
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 a changelog for x.py and nag contributors until they read it #76626
Conversation
This comment has been minimized.
This comment has been minimized.
185aef5
to
7f7afb1
Compare
Example output:
|
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.
Looks good to me except the last thing mentioned.
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 make sure that configure generates the appropriate version such that you don't immediately get nagged.
src/bootstrap/README.md
Outdated
* A change in the default options. | ||
|
||
Changes that do not affect contributors to the compiler or users | ||
building rustc from source don't need an update to `VERSION` (although they |
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.
Hm, what would an example of such a change be? It feels like if it affects no one, it should not be in the changelog...
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.
Good point, I'll remove that bit.
Do you still think this should warn when a new configuration option is added? That's not a breaking change, although we still might want to tell people about it.
5bd4611
to
82a5fde
Compare
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.
Looks good to me.
This comment has been minimized.
This comment has been minimized.
82a5fde
to
3d51d09
Compare
Missed this comment the first time, sorry. I'm not sure whether that's helpful - distro maintainers (cc @infinity0) will also want to know if x.py had major changes. If If they have seen the changes, they can always pass |
Hm, I guess that's an interesting point. Probably given that we regularly generate hundreds of log lines anyway a warning at the beginning doesn't matter too much... |
We could add another option to make the warning fatal? 😆 |
Might be useful to look into reducing that ... but that's separate from this change. |
ping @Mark-Simulacrum - is this waiting on anything from me? Did you want me to implement the (optional) hard error if the versions don't match? |
src/bootstrap/bin/main.rs
Outdated
@@ -12,5 +12,26 @@ use bootstrap::{Build, Config}; | |||
fn main() { | |||
let args = env::args().skip(1).collect::<Vec<_>>(); | |||
let config = Config::parse(&args); | |||
check_version(&config); |
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.
Can we re-print this at the end of the build? I worry that in the not atypical case of quick screen-filling output the helpful message will otherwise get lost. And in cases where very little output is given, it seems not horrible to have a couple extra lines, maybe with some kind of prefix to make it clear it's a repeat.
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 changed this to print twice, but because rustbuild uses std::process::exit
, it won't get printed if an error occurs.
Successful message:
$ x.py test tidy
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 1` to `config.toml`
Building stage0 tool tidy (x86_64-unknown-linux-gnu)
Finished release [optimized + debuginfo] target(s) in 0.08s
tidy check
* 617 error codes
* highest error code: E0774
Checking which error codes lack tests...
Found 430 error codes
Found 0 error codes with no tests
Done!
* 298 features
fmt check
skip untracked path src/bootstrap/defaults/ during rustfmt invocations
skip untracked path src/tmp.txt during rustfmt invocations
skip untracked path tmp.rs during rustfmt invocations
skip untracked path x.rs during rustfmt invocations
skip untracked path y.rs during rustfmt invocations
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 1` to `config.toml`
note: this message was printed twice to make it more likely to be seen
Build completed successfully in 0:00:06
Message on error:
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 1` to `config.toml`
Building stage0 tool tidy (x86_64-unknown-linux-gnu)
Finished release [optimized + debuginfo] target(s) in 0.09s
tidy check
* 617 error codes
* highest error code: E0774
Checking which error codes lack tests...
Found 430 error codes
Found 0 error codes with no tests
Done!
tidy error: /home/joshua/rustc/src/bootstrap/bin/main.rs:6: trailing whitespace
some tidy checks failed
command did not execute successfully: "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/home/joshua/rustc" "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0/bin/cargo"
expected success, got: exit code: 1
failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy
Build completed unsuccessfully in 0:00:03
Maybe it could be moved to bootstrap.py
or x.py
instead?
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.
Hm let's avoid that for now.
Okay, I would appreciate:
Also left a few nits/suggestions. |
📌 Commit 8e10905 has been approved by |
…acrum Add a changelog for x.py and nag contributors until they read it Add a changelog for x.py - Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read. There's no way to tie reading the changelog to updating the version, so unfortunately they still have to update `config.toml` manually. Actually reading the changelog is optional, anyone can set `changelog-seen = N` without reading (although it's not recommended). - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added Closes rust-lang#76617 r? @Mark-Simulacrum
failed in rollup |
@bors r- |
@Dylan-DPC it's a merge conflict with #76628, I can't fix it until that PR's merged. |
8e10905
to
ee1b6da
Compare
@bors r=Mark-Simulacrum |
📌 Commit ee1b6dada962a2f7cb2c8f1b55b83c4a17e43077 has been approved by |
- Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added
ee1b6da
to
fe6fc55
Compare
📌 Commit fe6fc55 has been approved by |
…acrum Add a changelog for x.py and nag contributors until they read it Add a changelog for x.py - Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read. There's no way to tie reading the changelog to updating the version, so unfortunately they still have to update `config.toml` manually. Actually reading the changelog is optional, anyone can set `changelog-seen = N` without reading (although it's not recommended). - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added Closes rust-lang#76617 r? @Mark-Simulacrum
☀️ Test successful - checks-actions, checks-azure |
@jyn514 I just noticed this, sorry I didn't find time to reply to your other messages. Thanks for pinging, this will be fine. Moving forward the changelog ought to omit minor things (that don't affect external behaviour) otherwise it would be redundant wrt |
Add a changelog for x.py
changelog-seen
inconfig.toml
andVERSION
in bootstrap to determine whether the changelog has been read. There's no way to tie reading the changelog to updating the version, so unfortunately they still have to updateconfig.toml
manually. Actually reading the changelog is optional, anyone can setchangelog-seen = N
without reading (although it's not recommended).Closes #76617
r? @Mark-Simulacrum