Skip to content

Commit fa0a21c

Browse files
authored
Merge pull request #5957 from hugocaillard/fix/no-default-feature-compilation
2 parents d870a8e + e4b4f65 commit fa0a21c

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

clarity/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ regex = "1.9.3"
2929
lazy_static = "1.4.0"
3030
integer-sqrt = "0.1.3"
3131
slog = { version = "2.5.2", features = [ "max_level_trace" ], optional = true }
32-
stacks_common = { path= "../stacks-common", package = "stacks-common", optional = true, default-features = false }
32+
stacks_common = { path= "../stacks-common", package = "stacks-common", default-features = false }
3333
rstest = { version = "0.17.0", optional = true }
3434
rstest_reuse = { version = "0.5.0", optional = true }
3535
wasmtime = { version = "15.0.0", optional = true }
@@ -56,11 +56,12 @@ mutants = "0.0.3"
5656
# criterion = "0.3"
5757

5858
[features]
59-
default = ["rusqlite", "log", "clarity-wasm", "serde_stacker"]
59+
default = ["rusqlite", "log", "clarity-wasm", "serde_stacker", "vrf"]
6060
clarity-wasm = ["wasmtime"]
6161
developer-mode = ["stacks_common/developer-mode"]
6262
slog_json = ["stacks_common/slog_json"]
6363
rusqlite = ["stacks_common/rusqlite", "dep:rusqlite"]
64+
vrf = ["stacks_common/vrf"]
6465
devtools = []
6566
rollback_value_check = []
6667
disable-costs = []

clarity/src/libclarity.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#![cfg_attr(test, allow(unused_variables, unused_assignments))]
2222

2323
#[allow(unused_imports)]
24+
#[cfg(feature = "log")]
2425
#[macro_use(o, slog_log, slog_trace, slog_debug, slog_info, slog_warn, slog_error)]
2526
extern crate slog;
2627

clarity/src/vm/database/structures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ macro_rules! clarity_serializable {
5353
}
5454
}
5555
impl ClarityDeserializable<$Name> for $Name {
56-
#[cfg(not(feature = "wasm"))]
56+
#[cfg(feature = "default")]
5757
fn deserialize(json: &str) -> Result<Self> {
5858
let mut deserializer = serde_json::Deserializer::from_str(&json);
5959
// serde's default 128 depth limit can be exhausted
@@ -66,7 +66,7 @@ macro_rules! clarity_serializable {
6666
InterpreterError::Expect("Failed to deserialize vm.Value".into()).into()
6767
})
6868
}
69-
#[cfg(feature = "wasm")]
69+
#[cfg(not(feature = "default"))]
7070
fn deserialize(json: &str) -> Result<Self> {
7171
serde_json::from_str(json).map_err(|_| {
7272
InterpreterError::Expect("Failed to deserialize vm.Value".into()).into()

stacks-common/src/libcommon.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#![allow(clippy::assertions_on_constants)]
88

99
#[allow(unused_imports)]
10+
#[cfg(feature = "log")]
1011
#[macro_use(o, slog_log, slog_trace, slog_debug, slog_info, slog_warn, slog_error)]
1112
extern crate slog;
1213

stacks-common/src/types/sqlite.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use crate::types::chainstate::{
2323
};
2424
use crate::util::hash::{Hash160, Sha512Trunc256Sum};
2525
use crate::util::secp256k1::{MessageSignature, SchnorrSignature};
26+
#[cfg(feature = "vrf")]
2627
use crate::util::vrf::VRFProof;
2728

2829
pub const NO_PARAMS: &[&dyn ToSql] = &[];
@@ -49,6 +50,7 @@ impl_byte_array_rusqlite_only!(Hash160);
4950
impl_byte_array_rusqlite_only!(BlockHeaderHash);
5051
impl_byte_array_rusqlite_only!(VRFSeed);
5152
impl_byte_array_rusqlite_only!(BurnchainHeaderHash);
53+
#[cfg(feature = "vrf")]
5254
impl_byte_array_rusqlite_only!(VRFProof);
5355
impl_byte_array_rusqlite_only!(TrieHash);
5456
impl_byte_array_rusqlite_only!(Sha512Trunc256Sum);

0 commit comments

Comments
 (0)