diff --git a/Cargo.toml b/Cargo.toml index d3bb8f30a..585c78d9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ check-cfg = [ ] [workspace.dependencies] -ahash = "0.8.11" +ahash = { version = "0.8.11", default-features = false } anyhow = "1.0.96" arbitrary = "1.4.1" ark-bn254 = "0.4.0" diff --git a/feature-set/Cargo.toml b/feature-set/Cargo.toml index c160b2cb0..7ba2e1ead 100644 --- a/feature-set/Cargo.toml +++ b/feature-set/Cargo.toml @@ -10,7 +10,6 @@ license = { workspace = true } edition = { workspace = true } [dependencies] -ahash = { workspace = true } lazy_static = { workspace = true } solana-epoch-schedule = { workspace = true } solana-frozen-abi = { workspace = true, optional = true, features = [ @@ -19,8 +18,14 @@ solana-frozen-abi = { workspace = true, optional = true, features = [ solana-frozen-abi-macro = { workspace = true, optional = true, features = [ "frozen-abi", ] } -solana-hash = { workspace = true } solana-pubkey = { workspace = true } + +[target.'cfg(target_os = "solana")'.dependencies] +ahash = { workspace = true, default-features = false, features = ["std", "no-rng"] } + +[target.'cfg(not(target_os = "solana"))'.dependencies] +ahash = { workspace = true, default-features = true } +solana-hash = { workspace = true } solana-sha256-hasher = { workspace = true } [features] diff --git a/feature-set/src/lib.rs b/feature-set/src/lib.rs index 75a8b17f8..f82430ded 100644 --- a/feature-set/src/lib.rs +++ b/feature-set/src/lib.rs @@ -23,9 +23,7 @@ use { ahash::{AHashMap, AHashSet}, lazy_static::lazy_static, solana_epoch_schedule::EpochSchedule, - solana_hash::Hash, solana_pubkey::Pubkey, - solana_sha256_hasher::Hasher, }; pub mod deprecate_rewards_sysvar { @@ -1190,10 +1188,13 @@ lazy_static! { .iter() .cloned() .collect(); +} +#[cfg(not(target_os = "solana"))] +lazy_static! { /// Unique identifier of the current software's feature set - pub static ref ID: Hash = { - let mut hasher = Hasher::default(); + pub static ref ID: solana_hash::Hash = { + let mut hasher = solana_sha256_hasher::Hasher::default(); let mut feature_ids = FEATURE_NAMES.keys().collect::>(); feature_ids.sort(); for feature in feature_ids {