fix(rust): handle rustup check exit code 100 as non-error#8832
Conversation
`rustup check` returns exit code 100 when toolchain updates are available, which is normal behavior and not an error. Previously, mise treated this as a failure, causing `mise outdated` to report: "Error getting outdated info for core:rust@stable: command [\"rustup\", \"check\"] exited with code 100" This change uses `.unchecked().run()` instead of `.read()` to manually handle the exit code, allowing mise to parse the output and detect updates correctly even when rustup returns 100. Fixes the issue where `mise outdated` fails when rust toolchain updates are available.
There was a problem hiding this comment.
Code Review
This pull request modifies the Rust plugin to correctly handle exit code 100 from 'rustup check', which signifies available updates rather than a failure. A review comment suggests refining the error handling because the current use of '.unchecked()' suppresses all non-zero exit codes, potentially hiding genuine errors. It is recommended to explicitly verify that the exit code is either 0 or 100.
Greptile SummaryThis PR fixes Key changes:
Confidence Score: 5/5Safe to merge — the fix is minimal, correct, and the prior concern about swallowed error codes has been resolved. The change correctly restricts the non-error treatment to exactly exit codes 0 and 100, bailing with a clear diagnostic for anything else. The previous reviewer concern about silently swallowing all non-zero exit codes was already addressed in this revision. No regressions are apparent and the logic is straightforward. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[outdated_info called] --> B{Is version a semver?}
B -- Yes --> C[OutdatedInfo::resolve via registry]
B -- No --> D[Run rustup check unchecked]
D --> E{Exit code?}
E -- 0 --> F[Parse stdout for update lines]
E -- 100 --> F
E -- other --> G[bail with exit code and stderr]
F --> H{Line matches target triple and version regex?}
H -- Yes --> I[Return Some OutdatedInfo]
H -- No --> J[Return None]
Reviews (4): Last reviewed commit: "fix(backend): include rustup check stder..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
I think greptile is right that we should include stderr in the error message |
### 🚀 Features - add azd (Azure Developer CLI) to registry by @rajeshkamal5050 in [#8828](#8828) ### 🐛 Bug Fixes - **(aqua)** skip registry lookup for linked versions in list_bin_paths by @nikobockerman in [#8801](#8801) - **(rust)** handle rustup check exit code 100 as non-error by @shalk in [#8832](#8832) - **(task)** resolve bare aliases in monorepo with config_roots by @nkakouros in [#8819](#8819) - show usage help when long_about is defined w/o args/flags by @nkakouros in [#8824](#8824) ### 📚 Documentation - fix serif font in sidebar and increase heading sizes by @jdx in [#8831](#8831) - fix #vscode link in ide integration page by @jedymatt in [#8833](#8833) - fix nested Markdown code fences by @muzimuzhi in [#8835](#8835) ### New Contributors - @shalk made their first contribution in [#8832](#8832) - @jedymatt made their first contribution in [#8833](#8833) - @nikobockerman made their first contribution in [#8801](#8801) - @rajeshkamal5050 made their first contribution in [#8828](#8828) ## 📦 Aqua Registry Updates #### New Packages (2) - [`gastownhall/beads`](https://github.com/gastownhall/beads) - [`getdbt.com/dbt-fusion`](https://github.com/getdbt.com/dbt-fusion) #### Updated Packages (2) - [`Azure/azure-dev`](https://github.com/Azure/azure-dev) - [`magefile/mage`](https://github.com/magefile/mage)
Summary
Fixes the issue where
mise outdatedfails when rust toolchain updates areavailable.
Problem
rustup checkreturns exit code 100 when toolchain updates are available, whichis normal behavior and not an error. Previously, mise treated this as a failure,
causing
mise outdatedto report:Error getting outdated info for core:rust@stable: command ["rustup", "check"]
exited with code 100
Solution
Changed the
outdated_infomethod insrc/plugins/core/rust.rsto use.unchecked().run()instead of.read(), allowing mise to manually handle theexit code and parse the output correctly even when rustup returns 100.
Testing
cargo build --releasecargo checkEOF