Skip to content

Commit

Permalink
build.rs: check that cargo binary exists, use exported one otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-dumitrescu committed Nov 28, 2023
1 parent 892dd44 commit 5aa584a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hermit/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ fn cargo() -> Command {
// To reach the rustup proxy nonetheless, we explicitly query $CARGO_HOME.
let mut cargo_home = PathBuf::from(env::var_os("CARGO_HOME").unwrap());
cargo_home.push("bin/cargo");
cargo_home
if cargo_home.exists() {
cargo_home
} else {
PathBuf::from("cargo")
}
};

let mut cargo = Command::new(cargo);
Expand Down

0 comments on commit 5aa584a

Please sign in to comment.