Skip to content

Commit

Permalink
Merge pull request #223 from near/debug_windows_ci
Browse files Browse the repository at this point in the history
Fix npm run on Windows
  • Loading branch information
aborg-dev authored Feb 19, 2024
2 parents 1b88a90 + f6ca593 commit 8da9e89
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions cranelift/filetests/src/zkasm_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,24 @@ pub fn run_zkasm_path(input_path: &Path) -> anyhow::Result<Vec<ExecutionResult>>
)?;

let mut output_file = NamedTempFile::new()?;
let common_args = [
"--prefix",
"../../tests/zkasm",
"test",
input_path.to_str().unwrap(),
output_file.path().to_str().unwrap(),
];

#[cfg(target_os = "windows")]
let output = std::process::Command::new("cmd")
.args(["/C", "npm"])
.args(common_args)
.output()?;
#[cfg(not(target_os = "windows"))]
let output = std::process::Command::new("npm")
.args([
"--prefix",
"../../tests/zkasm",
"test",
input_path.to_str().unwrap(),
output_file.path().to_str().unwrap(),
])
.args(common_args)
.output()?;

if !output.status.success() {
return Err(anyhow::anyhow!(
"Failed to run `npm`: {}; stderr: {}",
Expand Down

0 comments on commit 8da9e89

Please sign in to comment.