Skip to content

Commit

Permalink
chore(blockifier): use the suggested test util for cargo manifest dir…
Browse files Browse the repository at this point in the history
… in cairo compile
  • Loading branch information
ArniStarkware committed Nov 26, 2024
1 parent 3d36600 commit 37e9187
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/blockifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cairo-vm.workspace = true
derive_more.workspace = true
indexmap.workspace = true
itertools.workspace = true
infra_utils.workspace = true
keccak.workspace = true
log.workspace = true
num-bigint.workspace = true
Expand Down
7 changes: 3 additions & 4 deletions crates/blockifier/src/test_utils/cairo_compile.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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()),
)
Expand Down

0 comments on commit 37e9187

Please sign in to comment.