From 9147824998b3cc2322ebb0a6632774f737791daf Mon Sep 17 00:00:00 2001 From: Andrei Kashin Date: Fri, 1 Mar 2024 11:31:10 +0000 Subject: [PATCH] Use stable path to node module --- cranelift/filetests/src/zkasm_runner.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cranelift/filetests/src/zkasm_runner.rs b/cranelift/filetests/src/zkasm_runner.rs index df14d5d389d5..3576c77ca8f5 100644 --- a/cranelift/filetests/src/zkasm_runner.rs +++ b/cranelift/filetests/src/zkasm_runner.rs @@ -73,10 +73,18 @@ pub fn run_zkasm_path(input_path: &Path) -> anyhow::Result> include_str!("../../zkasm_data/generated/helpers/2-exp.zkasm"), )?; + // The node module necessary to execute zkAsm lives in `wasmtime/tests/zkasm/package.json`. + // We are trying to create a path to it that would work regardless of the current working + // directory that the caller is using. + let node_module_path = Path::new(env!("CARGO_MANIFEST_DIR")) + .join("../../tests/zkasm/") + .display() + .to_string(); + let mut output_file = NamedTempFile::new()?; let common_args = [ "--prefix", - "../../tests/zkasm", + &node_module_path, "test", input_path.to_str().unwrap(), output_file.path().to_str().unwrap(),