Skip to content
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

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Sep 12, 2020

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 #76617
r? @Mark-Simulacrum

@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 12, 2020
@rust-highfive

This comment has been minimized.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 12, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 12, 2020

Example output:

$ x.py check
Updating only changed submodules
Submodules updated in 0.02 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
warning: x.py has made several changes in the past month you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `version = 0` to `config.toml`
Checking std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking core v0.0.0 (/home/joshua/rustc/library/core)
^C  Building [==============>                                           ] 9/33: ...

config.toml.example Outdated Show resolved Hide resolved
src/bootstrap/bin/main.rs Outdated Show resolved Hide resolved
config.toml.example Outdated Show resolved Hide resolved
config.toml.example Outdated Show resolved Hide resolved
config.toml.example Outdated Show resolved Hide resolved
src/bootstrap/bin/main.rs Outdated Show resolved Hide resolved
src/bootstrap/bin/main.rs Outdated Show resolved Hide resolved
@jyn514 jyn514 changed the title Add a changelog for x.py and nag contributors unless they read it Add a changelog for x.py and nag contributors until they read it Sep 12, 2020
src/bootstrap/config.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@pickfire pickfire left a 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.

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a 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.

config.toml.example Outdated Show resolved Hide resolved
config.toml.example Outdated Show resolved Hide resolved
src/bootstrap/CHANGELOG.md Outdated Show resolved Hide resolved
src/bootstrap/CHANGELOG.md Outdated Show resolved Hide resolved
* 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
Copy link
Member

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...

Copy link
Member Author

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.

src/bootstrap/bin/main.rs Outdated Show resolved Hide resolved
src/bootstrap/bin/main.rs Outdated Show resolved Hide resolved
src/bootstrap/config.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@pickfire pickfire left a 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.

@bors

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Sep 16, 2020

We should make sure that configure generates the appropriate version such that you don't immediately get nagged.

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 configure silently sets changelog-seen to the latest version, they won't see the difference.

If they have seen the changes, they can always pass --set version=1.

@Mark-Simulacrum
Copy link
Member

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...

@jyn514
Copy link
Member Author

jyn514 commented Sep 16, 2020

We could add another option to make the warning fatal? 😆

@jyn514
Copy link
Member Author

jyn514 commented Sep 16, 2020

given that we regularly generate hundreds of log lines anyway

Might be useful to look into reducing that ... but that's separate from this change.

@jyn514 jyn514 added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Sep 17, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 20, 2020

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/README.md Outdated Show resolved Hide resolved
@@ -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);
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

@Mark-Simulacrum
Copy link
Member

Okay, I would appreciate:

  • Squashing the commits down
  • Updating the PR description, looks like some stale notes of version still

Also left a few nits/suggestions.

@bors
Copy link
Contributor

bors commented Sep 20, 2020

📌 Commit 8e10905 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 20, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 21, 2020
…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
@Dylan-DPC-zz
Copy link

failed in rollup

@Dylan-DPC-zz
Copy link

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 21, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 21, 2020

@Dylan-DPC it's a merge conflict with #76628, I can't fix it until that PR's merged.

@jyn514
Copy link
Member Author

jyn514 commented Sep 21, 2020

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Sep 21, 2020

📌 Commit ee1b6dada962a2f7cb2c8f1b55b83c4a17e43077 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 21, 2020
- 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
@jyn514
Copy link
Member Author

jyn514 commented Sep 21, 2020

@bors r=Mark-Simulacrum

Forgot to add #76628 to the changelog.

@bors
Copy link
Contributor

bors commented Sep 21, 2020

📌 Commit fe6fc55 has been approved by Mark-Simulacrum

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 22, 2020
…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
@bors
Copy link
Contributor

bors commented Sep 22, 2020

⌛ Testing commit fe6fc55 with merge cbc5e4d...

@bors
Copy link
Contributor

bors commented Sep 22, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Mark-Simulacrum
Pushing cbc5e4d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 22, 2020
@bors bors merged commit cbc5e4d into rust-lang:master Sep 22, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 22, 2020
@jyn514 jyn514 deleted the x.py-changelog branch September 22, 2020 13:14
@infinity0
Copy link
Contributor

@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 git log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a changelog to x.py
9 participants