Skip to content

Commit 82fbfb1

Browse files
committed
make http-parser and ctrlc optional features
1 parent 1e60445 commit 82fbfb1

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ members = [
1616
[workspace.dependencies]
1717
ed25519-dalek = { version = "2.1.1", features = ["serde", "rand_core"] }
1818
hashbrown = { version = "0.15.2", features = ["serde"] }
19+
lazy_static = "1.4.0"
1920
rand_core = "0.6.4"
2021
rand = "0.8"
2122
rand_chacha = "0.3.1"
22-
tikv-jemallocator = "0.5.4"
23+
serde = "1"
24+
serde_derive = "1"
25+
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
26+
regex = "1"
2327
rusqlite = { version = "0.31.0", features = ["blob", "serde_json", "i128_blob", "bundled", "trace"] }
28+
tikv-jemallocator = "0.5.4"
2429
thiserror = "1.0.65"
2530
toml = "0.5.6"
2631

stacks-common/Cargo.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@ path = "./src/libcommon.rs"
3131

3232
[dependencies]
3333
rand = { workspace = true }
34-
serde = { version = "1.0", features = ["derive"] }
35-
serde_derive = "1"
34+
serde = { workspace = true , features = ["derive"] }
35+
serde_derive = { workspace = true }
3636
sha3 = "0.10.1"
3737
ripemd = "0.1.1"
38-
lazy_static = "1.4.0"
39-
slog = { version = "2.5.2", features = ["max_level_trace"] }
38+
lazy_static = { workspace = true }
39+
slog = { workspace = true }
4040
slog-term = "2.6.0"
4141
slog-json = { version = "2.3.0", optional = true }
4242
chrono = "0.4.19"
4343
hashbrown = { workspace = true }
44+
regex = { workspace = true }
4445
rusqlite = { workspace = true, optional = true }
4546

4647
[target.'cfg(unix)'.dependencies]
47-
nix = "0.23"
48+
nix = {version = "0.23", optional = true}
4849

4950
[target.'cfg(windows)'.dependencies]
5051
winapi = { version = "0.3", features = [
@@ -83,8 +84,10 @@ rand_core = { workspace = true }
8384
proptest = "1.6.0"
8485

8586
[features]
86-
default = ["developer-mode"]
87+
default = ["developer-mode", "ctrlc-handler", "http-parser"]
8788
developer-mode = []
89+
ctrlc-handler = ["dep:nix"]
90+
http-parser = []
8891
slog_json = ["slog-json"]
8992
rusqlite = ["dep:rusqlite"]
9093
testing = []
@@ -93,7 +96,7 @@ bech32_std = []
9396
bech32_strict = []
9497

9598
[build-dependencies]
96-
toml = "0.5.6"
99+
toml = { workspace = true }
97100

98101
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(any(target_os="windows"))))'.dependencies]
99102
sha2 = { version = "0.10", features = ["asm"] }

stacks-common/src/libcommon.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern crate slog;
1313
#[macro_use]
1414
extern crate serde_derive;
1515

16-
#[cfg(unix)]
16+
#[cfg(all(unix, feature = "ctrlc-handler"))]
1717
extern crate nix;
1818

1919
#[cfg(windows)]
@@ -29,7 +29,17 @@ pub mod types;
2929

3030
pub mod address;
3131

32-
pub mod deps_common;
32+
pub mod deps_common {
33+
pub mod bech32;
34+
pub mod bitcoin;
35+
36+
// These are gated by features.
37+
#[cfg(feature = "ctrlc-handler")]
38+
pub mod ctrlc;
39+
40+
#[cfg(feature = "http-parser")]
41+
pub mod httparse;
42+
}
3343

3444
pub mod bitvec;
3545

stacks-common/src/util/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
pub mod log;
1919
#[macro_use]
2020
pub mod macros;
21+
#[cfg(feature = "http-parser")]
2122
pub mod chunked_encoding;
2223
#[cfg(feature = "rusqlite")]
2324
pub mod db;

0 commit comments

Comments
 (0)