From 3f75d13b0d66aea7b4ae4053610f4bc7d85fdabe Mon Sep 17 00:00:00 2001 From: dorimedini-starkware Date: Mon, 16 Dec 2024 16:18:29 +0200 Subject: [PATCH] feat(native_blockifier): make cairo_native a feature of native blockifier (#2625) --- crates/native_blockifier/Cargo.toml | 5 +++-- scripts/build_native_blockifier.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/native_blockifier/Cargo.toml b/crates/native_blockifier/Cargo.toml index 7a04c090bc..e8227d110b 100644 --- a/crates/native_blockifier/Cargo.toml +++ b/crates/native_blockifier/Cargo.toml @@ -7,6 +7,7 @@ license-file.workspace = true description = "A Bridge between the Rust blockifier crate and Python." [features] +cairo_native = ["blockifier/cairo_native"] # Required for `cargo test` to work with Pyo3. # On Python, make sure to compile this with the extension-module feature enabled. # https://pyo3.rs/v0.19.1/faq#i-cant-run-cargo-test-or-i-cant-build-in-a-cargo-workspace-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror @@ -27,7 +28,7 @@ crate-type = ["cdylib"] [dependencies] # TODO(Dori, 1/1/2025): Add the "jemalloc" feature to the blockifier crate when possible. -blockifier = { workspace = true, features = ["cairo_native", "native_blockifier"] } +blockifier = { workspace = true, features = ["native_blockifier"] } cairo-lang-starknet-classes.workspace = true cairo-vm.workspace = true indexmap.workspace = true @@ -44,7 +45,7 @@ starknet_api.workspace = true thiserror.workspace = true [dev-dependencies] -blockifier = { workspace = true, features = ["cairo_native", "native_blockifier", "testing"] } +blockifier = { workspace = true, features = ["native_blockifier", "testing"] } cached.workspace = true papyrus_storage = { workspace = true, features = ["testing"] } pretty_assertions.workspace = true diff --git a/scripts/build_native_blockifier.sh b/scripts/build_native_blockifier.sh index e972bc8574..294de8483b 100755 --- a/scripts/build_native_blockifier.sh +++ b/scripts/build_native_blockifier.sh @@ -16,7 +16,7 @@ function build() { echo "Building..." pypy3.9 -m venv /tmp/venv source /tmp/venv/bin/activate - cargo build --release -p native_blockifier || clean + cargo build --release -p native_blockifier --features "cairo_native" || clean clean }