From cd9e713526ec99338e283add535533ad606c7fae Mon Sep 17 00:00:00 2001 From: Leo-Besancon Date: Wed, 15 Jan 2025 12:15:05 +0100 Subject: [PATCH] Fix features for massa-sc-runtime --- .cargo/config.toml | 2 +- massa-module-cache/Cargo.toml | 6 ++---- massa-xtask/Cargo.toml | 5 ++++- massa-xtask/src/main.rs | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 0132295d25c..c2210af35f3 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [alias] -xtask = "run --package massa_xtask --" \ No newline at end of file +xtask = "run --features gas_calibration --package massa_xtask --" \ No newline at end of file diff --git a/massa-module-cache/Cargo.toml b/massa-module-cache/Cargo.toml index 83a02d52330..33836c7f538 100644 --- a/massa-module-cache/Cargo.toml +++ b/massa-module-cache/Cargo.toml @@ -3,9 +3,6 @@ name = "massa_module_cache" version = "2.5.0" edition = "2021" -[features] -test-exports = ["massa-sc-runtime/testing"] - [dependencies] schnellru = {workspace = true} rand = {workspace = true} # BOM UPGRADE Revert to "0.8.5" if problem @@ -19,8 +16,9 @@ rocksdb = {workspace = true} massa_hash = {workspace = true} massa_models = {workspace = true} massa_serialization = {workspace = true} -massa-sc-runtime = {workspace = true, "features" = ["testing"]} +massa-sc-runtime = {workspace = true} [dev-dependencies] tempfile = {workspace = true} # BOM UPGRADE Revert to "3.3" if problem serial_test = {workspace = true} +massa-sc-runtime = {workspace = true, "features" = ["testing"]} diff --git a/massa-xtask/Cargo.toml b/massa-xtask/Cargo.toml index f4f32126d65..452904e6d75 100644 --- a/massa-xtask/Cargo.toml +++ b/massa-xtask/Cargo.toml @@ -3,10 +3,13 @@ name = "massa_xtask" version = "2.5.0" edition = "2021" +[features] +gas_calibration = ["massa-sc-runtime/gas_calibration"] + [dependencies] # update_package_versions dependencies massa_models = {workspace = true} toml_edit = {workspace = true} # BOM UPGRADE Revert to "0.19.8" if problem walkdir = {workspace = true} # check_gas_costs dependencies -massa-sc-runtime = {workspace = true, features = ["gas_calibration"]} +massa-sc-runtime = {workspace = true} diff --git a/massa-xtask/src/main.rs b/massa-xtask/src/main.rs index df8aacee12e..d2500d657bf 100644 --- a/massa-xtask/src/main.rs +++ b/massa-xtask/src/main.rs @@ -1,6 +1,8 @@ +#[cfg(feature = "gas_calibration")] mod check_gas_cost_definitions; mod update_package_versions; +#[cfg(feature = "gas_calibration")] use crate::check_gas_cost_definitions::check_gas_cost_definitions; use crate::update_package_versions::update_package_versions; use std::env; @@ -13,6 +15,7 @@ fn main() { match task.as_deref() { // We can add more tasks here Some("update_package_versions") => update_package_versions(), + #[cfg(feature = "gas_calibration")] Some("check_gas_cost_definitions") => check_gas_cost_definitions().unwrap(), _ => panic!("Unknown task"), }