Skip to content

Commit 0dab3d5

Browse files
committed
honor CARGO env var (for rustc bootstrap)
1 parent f0e8717 commit 0dab3d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bin/cargo-miri.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,14 @@ fn setup(ask_user: bool) {
231231
} else {
232232
println!("Installing xargo: `cargo install xargo -f`");
233233
}
234-
if !Command::new("cargo").args(&["install", "xargo", "-f"]).status().unwrap().success() {
234+
235+
let mut cargo = if let Ok(val) = std::env::var("CARGO") {
236+
// In rustc bootstrap, an env var tells us where to find cargo.
237+
Command::new(val)
238+
} else {
239+
Command::new("cargo")
240+
};
241+
if !cargo.args(&["install", "xargo", "-f"]).status().unwrap().success() {
235242
show_error(format!("Failed to install xargo"));
236243
}
237244
}

0 commit comments

Comments
 (0)