diff --git a/examples/op/common/build.rs b/examples/op/common/build.rs index 1ccc8ac7..a60f3246 100644 --- a/examples/op/common/build.rs +++ b/examples/op/common/build.rs @@ -17,14 +17,18 @@ use std::{env, path::PathBuf, process::Command}; fn main() { let manifest_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set")); - let foundry_root = manifest_dir.join("../contracts/"); + + let mut foundry_root = manifest_dir.clone(); + foundry_root.pop(); + foundry_root.push("contracts"); println!("foundry root: {}", foundry_root.display()); // Make sure the Verifier.sol file is always compiled. let status = Command::new("forge") .arg("build") .arg("Verifier.sol") - .current_dir(foundry_root) + .arg("--root") + .arg(foundry_root) .status() .expect("failed to execute process"); assert!(status.success(), "forge build failed");