Skip to content

Commit

Permalink
Set current dir at check_wasm_toolchain_installed at wasm-builder (pa…
Browse files Browse the repository at this point in the history
…ritytech#10284)

* Set current dir at check_wasm_toolchain_installed

* Add comments
  • Loading branch information
MOZGIII authored and ark0f committed Feb 27, 2023
1 parent 9720cda commit b2135fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions utils/wasm-builder/src/prerequisites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ fn check_wasm_toolchain_installed(
let manifest_path = temp.path().join("Cargo.toml").display().to_string();

let mut build_cmd = cargo_command.command();
// Chdir to temp to avoid including project's .cargo/config.toml
// by accident - it can happen in some CI environments.
build_cmd.current_dir(&temp);
build_cmd.args(&[
"build",
"--target=wasm32-unknown-unknown",
Expand All @@ -132,6 +135,9 @@ fn check_wasm_toolchain_installed(
}

let mut run_cmd = cargo_command.command();
// Chdir to temp to avoid including project's .cargo/config.toml
// by accident - it can happen in some CI environments.
run_cmd.current_dir(&temp);
run_cmd.args(&["run", "--manifest-path", &manifest_path]);

// Unset the `CARGO_TARGET_DIR` to prevent a cargo deadlock
Expand Down

0 comments on commit b2135fd

Please sign in to comment.