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

improve bootstrap change-tracking system #117815

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Nov 11, 2023

This PR aims to improve how change-tracking system works for bootstrap changes by doing the followings:

  • Enforce embedding directive informations about the changes on bootstrap/src/lib.rs.
  • Give more informative change inputs on the terminal (improve bootstrap change-tracking system #117815 (comment)).
  • Avoid spamming the change informations(by reading and creating .last-warned-change-id under build output dir).

see the zulip conversation for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/config.2Etoml.20change.20tracking

cc @RalfJung

@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2023

r? @albertlarsan68

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 11, 2023
triagebot.toml Outdated Show resolved Hide resolved
@albertlarsan68
Copy link
Member

I have a few questions:

  1. Does x clean clear the file? I would prefer if it did.
  2. Is the file created/updated only upon printing the second message? It would be bad if it was only shown once at the start, eclipsed by a few walls of texts, then never show again until the next time the field is updated.
  3. Maybe add a config (off by default) to always show it?

@Noratrieb
Copy link
Member

I think a problem with this system is that there are several audiences. First, there are rust-lang/rust developers. Then there are distros packaging Rust. These two audiences have very different needs. I would think that distros want to know about the all the breakage, while rust-lang/rust devs don't really care.
Maybe the message should look at the profile and only display the messages for profile = "dist"? Or maybe have two lists, those with less critical changes for distros and those with super important critical changes for everyone. Although I'm not sure whether super important critical changes for everyone even exist, or should ever exist.

@onur-ozkan
Copy link
Member Author

onur-ozkan commented Nov 11, 2023

// PR ID(to provide PR link for more input), log prefix, change summary
pub const CONFIG_CHANGE_HISTORY: &[(usize, &str, &str)] = &[
    (115898, "NOTE", "Implementation of this change-tracking system. Ignore this."),
    (116998, "INFO", "Removed android-ndk r15 support in favor of android-ndk r25b."),
    (117435, "INFO", "New option `rust.parallel-compiler` added to config.toml."),
    (116881, "WARNING", "Default value of `download-ci-llvm` was changed for `codegen` profile.")
];

Any thoughts on this(ignore the ugliness of the code)? This approach can automatically force PR authors to add change summaries.

@RalfJung in your use case, you will be able find what you are looking for directly on your terminal without needing to explore PR changes/descriptions. And if you need more input, you will be able to visit PR links still.

@albertlarsan68
Copy link
Member

Would be good if the severity was an Enum, so that different actions could be taken based on if it should be fatal or not (really breaking or just an information, show just once (at the end of the build preferably), or always)

@RalfJung
Copy link
Member

I would expect distros to check the changelog. So the changelog should have a section on config.toml changes. I don't think this system needs to be concerned with distros at all.

Any thoughts on this(ignore the ugliness of the code)? This approach can automatically force PR authors to add change summaries.

Yeah, that seems nice!

@onur-ozkan onur-ozkan force-pushed the update-change-tracking-impl branch 2 times, most recently from 6684b44 to 1903c98 Compare November 11, 2023 15:03
Comment on lines +131 to +138
msg.push_str(&format!(" [{}] {}\n", change.severity.to_string(), change.summary));
msg.push_str(&format!(
" - PR Link https://github.com/rust-lang/rust/pull/{}\n",
change.change_id
));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change results this format:

Building bootstrap
   Compiling bootstrap v0.0.0 (/home/nimda/devspace/onur-ozkan/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 4.85s
There have been changes to x.py since you last updated:
  [INFO] New option `rust.parallel-compiler` added to config.toml.
    - PR Link https://github.com/rust-lang/rust/pull/117435
  [INFO] Default value of `download-ci-llvm` was changed for `codegen` profile.
    - PR Link https://github.com/rust-lang/rust/pull/116881
note: to silence this warning, update `config.toml` to use `change-id = 116881` instead
Building stage0 tool tidy (x86_64-unknown-linux-gnu)

@onur-ozkan onur-ozkan force-pushed the update-change-tracking-impl branch 2 times, most recently from f479034 to de2bc42 Compare November 11, 2023 15:14
@onur-ozkan onur-ozkan changed the title print the change warnings once for per id improve bootstrap change-tracking system Nov 11, 2023
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the update-change-tracking-impl branch from a4f05c6 to 426a2f8 Compare November 11, 2023 15:50
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan
Copy link
Member Author

Does x clean clear the file? I would prefer if it did.

Yes it does clear the file.

It would be bad if it was only shown once at the start, eclipsed by a few walls of texts, then never show again until the next time the field is updated.

We print these logs twice (2nd print is at the end of bootstrap) to ensure devs will see them.

Maybe add a config (off by default) to always show it?

As this option doesn't exists in bootstrap for old branches, builds will fail on recent-to-old checkouts.

Printing these logs once for per initialization (after x clean, or on the fresh repository, or after rm -rf build) is fine in my opinion.

src/bootstrap/src/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the update-change-tracking-impl branch from 89829bb to 009e165 Compare November 12, 2023 10:26
Signed-off-by: onur-ozkan <work@onurozkan.dev>
As the .last-warned-change-id is only used for change tracking,
we don't need to generate/write it outside of the tty.
Otherwise, rust-analyzer could create this file, and developers
wouldn't be able to see the bootstrap change alerts, assuming
that they have already seen them.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan
Copy link
Member Author

-kindly reminder ping- @albertlarsan68

Copy link
Member

@albertlarsan68 albertlarsan68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sorry for the delay

@albertlarsan68
Copy link
Member

Thanks for the PR!
@bors r+

@bors
Copy link
Contributor

bors commented Nov 23, 2023

📌 Commit 9a6afd0 has been approved by albertlarsan68

It is now in the queue for this repository.

@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 Nov 23, 2023
@bors
Copy link
Contributor

bors commented Nov 23, 2023

⌛ Testing commit 9a6afd0 with merge 91f7f26...

@bors
Copy link
Contributor

bors commented Nov 23, 2023

☀️ Test successful - checks-actions
Approved by: albertlarsan68
Pushing 91f7f26 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 23, 2023
@bors bors merged commit 91f7f26 into rust-lang:master Nov 23, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 23, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (91f7f26): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

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

mean range count
Regressions ❌
(primary)
4.6% [3.7%, 5.6%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.6% [3.7%, 5.6%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 676.441s -> 677.025s (0.09%)
Artifact size: 313.75 MiB -> 313.73 MiB (-0.01%)

psumbera added a commit to psumbera/rust that referenced this pull request Nov 24, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 25, 2023
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 25, 2023
…ertlarsan68

improve bootstrap change-tracking system

This PR aims to improve how change-tracking system works for bootstrap changes by doing the followings:

- Enforce embedding directive informations about the changes on `bootstrap/src/lib.rs`.
- Give more informative change inputs on the terminal (rust-lang/rust#117815 (comment)).
- Avoid spamming the change informations(by reading and creating `.last-warned-change-id` under build output dir).

see the zulip conversation for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/config.2Etoml.20change.20tracking

cc `@RalfJung`
@onur-ozkan onur-ozkan deleted the update-change-tracking-impl branch January 27, 2024 09:21
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
…ertlarsan68

improve bootstrap change-tracking system

This PR aims to improve how change-tracking system works for bootstrap changes by doing the followings:

- Enforce embedding directive informations about the changes on `bootstrap/src/lib.rs`.
- Give more informative change inputs on the terminal (rust-lang/rust#117815 (comment)).
- Avoid spamming the change informations(by reading and creating `.last-warned-change-id` under build output dir).

see the zulip conversation for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/config.2Etoml.20change.20tracking

cc `@RalfJung`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
…ertlarsan68

improve bootstrap change-tracking system

This PR aims to improve how change-tracking system works for bootstrap changes by doing the followings:

- Enforce embedding directive informations about the changes on `bootstrap/src/lib.rs`.
- Give more informative change inputs on the terminal (rust-lang/rust#117815 (comment)).
- Avoid spamming the change informations(by reading and creating `.last-warned-change-id` under build output dir).

see the zulip conversation for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/config.2Etoml.20change.20tracking

cc `@RalfJung`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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.

9 participants