diff --git a/Cargo.lock b/Cargo.lock index dd4c794b3e..758d84013a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1498,6 +1498,7 @@ dependencies = [ "derive_more 0.99.18", "glob", "indexmap 2.6.0", + "infra_utils", "itertools 0.12.1", "keccak", "log", diff --git a/crates/blockifier/Cargo.toml b/crates/blockifier/Cargo.toml index 7f05e3127d..7532385cec 100644 --- a/crates/blockifier/Cargo.toml +++ b/crates/blockifier/Cargo.toml @@ -32,6 +32,7 @@ cairo-native = { workspace = true, optional = true } cairo-vm.workspace = true derive_more.workspace = true indexmap.workspace = true +infra_utils.workspace = true itertools.workspace = true keccak.workspace = true log.workspace = true diff --git a/crates/blockifier/src/test_utils/cairo_compile.rs b/crates/blockifier/src/test_utils/cairo_compile.rs index a0c5f77a8d..4e33523959 100644 --- a/crates/blockifier/src/test_utils/cairo_compile.rs +++ b/crates/blockifier/src/test_utils/cairo_compile.rs @@ -1,9 +1,10 @@ use std::io::Write; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use std::process::{Command, Output}; use std::{env, fs}; use cached::proc_macro::cached; +use infra_utils::path::cargo_manifest_dir; use serde::{Deserialize, Serialize}; use tempfile::NamedTempFile; @@ -69,9 +70,7 @@ pub fn cairo1_compiler_tag() -> String { /// overridden by the environment variable (otherwise, the default is used). fn local_cairo1_compiler_repo_path() -> PathBuf { // Location of blockifier's Cargo.toml. - let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); - - Path::new(&manifest_dir).join( + cargo_manifest_dir().unwrap().join( env::var(CAIRO1_REPO_RELATIVE_PATH_OVERRIDE_ENV_VAR) .unwrap_or_else(|_| DEFAULT_CAIRO1_REPO_RELATIVE_PATH.into()), )