Skip to content

Commit 537e1bf

Browse files
fix(rust): handle rustup check exit code 100 as non-error (#8832)
## Summary Fixes the issue where `mise outdated` fails when rust toolchain updates are available. ## Problem `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 ## Solution Changed the `outdated_info` method in `src/plugins/core/rust.rs` to use `.unchecked().run()` instead of `.read()`, allowing mise to manually handle the exit code and parse the output correctly even when rustup returns 100. ## Testing - Built successfully with `cargo build --release` - Verified with `cargo check` EOF --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 3774ac3 commit 537e1bf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/plugins/core/rust.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,19 @@ impl Backend for RustPlugin {
222222
for (k, v) in self.exec_env(config, ts, tv).await? {
223223
cmd = cmd.env(k, v);
224224
}
225-
let out = cmd.read()?;
225+
// rustup check returns exit code 100 when updates are available
226+
// This is not an error, so we use unchecked() and check status manually
227+
let result = cmd.stdout_capture().stderr_capture().unchecked().run()?;
228+
let exit_code = result.status.code().unwrap_or(-1);
229+
if exit_code != 0 && exit_code != 100 {
230+
let stderr = String::from_utf8_lossy(&result.stderr);
231+
eyre::bail!(
232+
"command [\"rustup\", \"check\"] exited with code {}. stderr: {}",
233+
exit_code,
234+
stderr.trim()
235+
);
236+
}
237+
let out = String::from_utf8_lossy(&result.stdout);
226238
for line in out.lines() {
227239
if line.starts_with(&self.target_triple(tv))
228240
&& let Some(_cap) = v_re.captures(line)

0 commit comments

Comments
 (0)