Skip to content

feat(cli): add --check flag to rustup update to return exact Exitcode - #5049

Merged
rami3l merged 2 commits into
rust-lang:mainfrom
14elias:feat/4987-update-check-exit-code
Sep 4, 2026
Merged

feat(cli): add --check flag to rustup update to return exact Exitcode#5049
rami3l merged 2 commits into
rust-lang:mainfrom
14elias:feat/4987-update-check-exit-code

Conversation

@14elias

@14elias 14elias commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes #4987.

Summary
Add --check flag to rustup update that reports whether any toolchains were updated or installed through the Exitcode.

Behavior

  • returns Exitcode(100) if updates/installations occur when we run rustup update --check
  • returns Exitcode(0) when no updates/installation occur.
  • keeps the existing behavior unchanged if --check flag is not passed

Tests

  • No available updates
  • A single updated toolchain
  • Multiple updated toolchains
  • No installed toolchains
  • Existing behavior without --check
  • Forced updates with --check

@rami3l
rami3l self-requested a review September 3, 2026 07:49
@rami3l rami3l linked an issue Sep 3, 2026 that may be closed by this pull request

@rami3l rami3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot for your contribution :)

View changes since this review

Comment thread tests/suite/cli_update_check.rs Outdated
Comment thread tests/suite/cli_update_check.rs Outdated
Comment thread tests/suite/cli_update_check.rs Outdated
Comment thread src/cli/common.rs Outdated
Comment thread src/cli/rustup_mode.rs Outdated
Comment thread src/cli/common.rs Outdated
Comment thread tests/suite/cli_update_check.rs Outdated
@14elias
14elias force-pushed the feat/4987-update-check-exit-code branch from fc12cdd to da55b51 Compare September 3, 2026 13:20
@rustbot

This comment has been minimized.

Comment thread tests/suite/cli_rustup.rs Outdated
Comment thread tests/suite/cli_rustup.rs
@djc

djc commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Sorry, what's the use case here? I don't see a linked issue or anything and am having trouble making sense of what this is for.

@rami3l

rami3l commented Sep 4, 2026

Copy link
Copy Markdown
Member

Sorry, what's the use case here? I don't see a linked issue or anything and am having trouble making sense of what this is for.

The linked issue is #4987 (in the Development section). Basically Josh wants something similar to our rustup check exit codes in rustup update.

I've edited the PR description for better visibility.

@rustbot

This comment has been minimized.

@14elias

14elias commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

☔ The latest upstream changes (possibly #5052) made this pull request unmergeable. Please resolve the merge conflicts.

@rami3l Hi, Could you help me fix this merge conflict issue?

@rami3l

rami3l commented Sep 4, 2026

Copy link
Copy Markdown
Member

☔ The latest upstream changes (possibly #5052) made this pull request unmergeable. Please resolve the merge conflicts.

@rami3l Hi, Could you help me fix this merge conflict issue?

@14elias I think you should be able to do it yourself? The upstream changes are only style-related, and not largely breaking.

@14elias
14elias force-pushed the feat/4987-update-check-exit-code branch from 0853ef0 to 34dd26c Compare September 4, 2026 14:25
@rustbot

rustbot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

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.

@rami3l rami3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks pretty good to me modulo the unresolved issues.

Once you have addressed them I think we can merge it real quick.

Many thanks again 🙏

View changes since this review

@14elias
14elias force-pushed the feat/4987-update-check-exit-code branch from 34dd26c to 0edd5d9 Compare September 4, 2026 19:10
@rami3l
rami3l enabled auto-merge September 4, 2026 19:29
@rami3l
rami3l added this pull request to the merge queue Sep 4, 2026
@14elias

14elias commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

This looks pretty good to me modulo the unresolved issues.

Once you have addressed them I think we can merge it real quick.

Many thanks again 🙏

View changes since this review

thank you so much @rami3l for your kind words.I am also grateful to contribute to rustup and i am looking forward to continuing to contribute.

Merged via the queue into rust-lang:main with commit 60e495a Sep 4, 2026
31 checks passed
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.

Option to indicate update via exit code

5 participants