Skip to content

Hint that a new Rust release may be available#4869

Draft
FranciscoTGouveia wants to merge 3 commits into
rust-lang:mainfrom
FranciscoTGouveia:new-rust-release
Draft

Hint that a new Rust release may be available#4869
FranciscoTGouveia wants to merge 3 commits into
rust-lang:mainfrom
FranciscoTGouveia:new-rust-release

Conversation

@FranciscoTGouveia
Copy link
Copy Markdown
Contributor

Closes #4846.

After a rustup command completes (excluding proxy commands), rustup checks whether a new Rust release is available.

To avoid introducing any additional overhead, this feature does not communicate with the release server.
Instead, it checks whether the stable toolchain manifest date is more than six weeks old.
Since Rust follows a regular and predictable release cadence, this should provide a sufficiently accurate indication that a new release is available.

When an outdated stable toolchain is detected, rustup prints a hint suggesting that the user may update their stable toolchain; this hint is shown at most once per day.
Users who prefer not to receive these hints can opt out by setting the RUSTUP_NO_RELEASE_HINT environment variable.

I have run some benchmarks (100 iterations) for the rustup show command and observed no significant slowdown (1.1x) when we do not show the hint.
However, due to manifest parsing, there is a 1.4x slowdown when the hint is shown (once per day).

Feedback is appreciated on:

  1. Whether this approach and its associated overhead are acceptable, or if we should take a different direction;
  2. Which rustup commands should display this hint;
  3. Whether relying on Rust’s regular release cadence, instead of contacting the release server, is acceptable;

Comment thread src/cli/common.rs Outdated
Comment thread src/cli/common.rs
return Ok(());
}

cfg.settings_file.with_mut(|s| {
Copy link
Copy Markdown
Member

@rami3l rami3l May 24, 2026

Choose a reason for hiding this comment

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

I still think it might be harmful to write this in settings_file; I'd suggest if we were to write the timestamp to a file, it should be an individual one so that under XDG we can put it under ~/.local/state/rustup/ whereas the settings file should clearly be under ~/.config/rustup/.

cc @Cloud0310 for potential interaction/collaboration regarding XDG.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notify users when a new stable Rust release is available

2 participants