Hint that a new Rust release may be available#4869
Conversation
0679b12 to
f9a9d91
Compare
This comment has been minimized.
This comment has been minimized.
f9a9d91 to
bebc2bf
Compare
| - `RUSTUP_NO_BACKTRACE`. Disables backtraces on non-panic errors even when | ||
| `RUST_BACKTRACE` is set. | ||
|
|
||
| - `RUSTUP_RELEASE_HINT` (default: `1`). When set to `0`, suppresses the hint |
There was a problem hiding this comment.
Do we have a strong reason to add this in addition to filesystem-based configuration? I am not a fan of the proliferation of environment variables that change rustup behavior.
There was a problem hiding this comment.
@djc I don't think #4869 (comment) is considered "configuration" because it just notes the last timestamp the routine is run...
There was a problem hiding this comment.
I mean the overall disabling via the environment variable; that feels like it should be configuration rather than environment variable.
There was a problem hiding this comment.
Something like rustup set release-hint false?
There was a problem hiding this comment.
What duplication do you mean? Perhaps an inline comment would make this clearer?
There was a problem hiding this comment.
@FranciscoTGouveia Sorry, but may I ask what you meant by #4869 (comment)? Looking at this thread I am afraid that we haven't fully addressed all the concerns but please feel free to dismiss me if I missed something.
There was a problem hiding this comment.
Whilst changing the approach from an env var, I created a new ReleaseHintMode enum for the rustup set command. Such an enum is somewhat redundant, since we already have AutoInstallMode, which is basically the same, hence my "duplication" comment.
Apologies for not making this clearer from the start, @rami3l.
My idea was to, after this PR, send a simplification patch to address said duplication.
There was a problem hiding this comment.
What's the rationale for not just fixing it in this PR?
There was a problem hiding this comment.
My idea was to not elongate this PR further.
I have already fixed it and merged the ReleaseHintMode and AutoInstallMode.
b64ea36 to
33eae97
Compare
33eae97 to
58ad136
Compare
58ad136 to
b9afdd1
Compare
This comment has been minimized.
This comment has been minimized.
4400790 to
b4a55d1
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
b4a55d1 to
a3e9eb0
Compare
a3e9eb0 to
882b94a
Compare
882b94a to
393929e
Compare
|
I believe all review comments are now addressed. |
|
@FranciscoTGouveia I think we can merge this first and see how it goes. Many thanks for making this patch :) PS: I won't backport this patch to 1.29 yet to give it more confidence WRT stability; if we hit #4942 in the process I think it's safe to just remove the state file. The more important thing here is that @Cloud0310 has a new file to migrate for XDG. |
393929e to
cc46266
Compare
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 with
rustup set release-hint false.I have run some benchmarks (100 iterations) for the
rustup showcommand 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: