Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blockifier): use infra utils dir in cairo compile #2284

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
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
4 changes: 3 additions & 1 deletion crates/blockifier/src/versioned_constants_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use glob::{glob, Paths};
use pretty_assertions::assert_eq;
use starknet_api::test_utils::path_in_resources;

use super::*;

Expand All @@ -8,7 +9,8 @@ use super::*;

/// Returns all JSON files in the resources directory (should be all versioned constants files).
fn all_jsons_in_dir() -> Paths {
glob(format!("{}/resources/*.json", env!("CARGO_MANIFEST_DIR")).as_str()).unwrap()
let pattern = path_in_resources("");
glob(format!("{}/*.json", pattern.display()).as_str()).unwrap()
}

#[test]
Expand Down
Loading