Skip to content

refactor: centralize dependencies and feature-gate stacks-common #6238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 12 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@ members = [

# Dependencies we want to keep the same between workspace members
[workspace.dependencies]
ed25519-dalek = { version = "2.1.1", features = ["serde", "rand_core"] }
ed25519-dalek = { version = "2.1.1", default-features = false }
hashbrown = { version = "0.15.2", features = ["serde"] }
lazy_static = "1.4.0"
rand_core = "0.6.4"
rand = "0.8"
rand_chacha = "0.3.1"
tikv-jemallocator = "0.5.4"
serde = "1"
serde_derive = "1"
serde_json = { version = "1.0", features = ["arbitrary_precision", "unbounded_depth"] }
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
rusqlite = { version = "0.31.0", features = ["blob", "serde_json", "i128_blob", "bundled", "trace"] }
tikv-jemallocator = "0.5.4"
thiserror = "1.0.65"
toml = "0.5.6"

# Use a bit more than default optimization for
# dev builds to speed up test execution
# dev builds to speed up test execution
[profile.dev]
opt-level = 1

# Use release-level optimization for dependencies
# This slows down "first" builds on development environments,
# but won't impact subsequent builds.
# but won't impact subsequent builds.
[profile.dev.package."*"]
opt-level = 3

Expand Down
90 changes: 45 additions & 45 deletions stacks-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,73 +30,73 @@ name = "stacks_common"
path = "./src/libcommon.rs"

[dependencies]
rand = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1"
sha3 = "0.10.1"
ripemd = "0.1.1"
lazy_static = "1.4.0"
slog = { version = "2.5.2", features = ["max_level_trace"] }
slog-term = "2.6.0"
slog-json = { version = "2.3.0", optional = true }
chrono = "0.4.19"
chrono = { version = "0.4.41", default-features = false, features = ["clock"] }
curve25519-dalek = { version = "4.1.3", default-features = false, features = ["serde"] }
ed25519-dalek = { workspace = true }
hashbrown = { workspace = true }
rusqlite = { workspace = true, optional = true }
lazy_static = { workspace = true }
ripemd = { version = "0.1.1", default-features = false }
serde = { workspace = true , features = ["derive"] }
serde_derive = { workspace = true }
serde_json = { workspace = true }
sha3 = { version = "0.10.1", default-features = false }
slog = { workspace = true }
slog-term = { version = "2.6.0", default-features = false }

# Optional dependencies
getrandom = { version = "0.2", default-features = false, optional = true }
rand = { workspace = true, optional = true }
slog-json = { version = "2.3.0", default-features = false, optional = true }

[target.'cfg(unix)'.dependencies]
nix = "0.23"
nix = {version = "0.23", default-features = false, optional = true}

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = [
"consoleapi",
"handleapi",
"synchapi",
"winbase",
] }

[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3", features = ["fileapi", "processenv", "winnt"] }

[dependencies.serde_json]
version = "1.0"
features = ["arbitrary_precision", "unbounded_depth"]

[dependencies.ed25519-dalek]
workspace = true

[dependencies.curve25519-dalek]
version = "4.1.3"
features = ["serde"]

[dependencies.time]
version = "0.2.23"
features = ["std"]
], optional = true }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
secp256k1 = { version = "0.24.3", features = ["serde", "recovery"] }
secp256k1 = { version = "0.24.3", default-features = false, features = ["std","serde", "recovery"] }
rusqlite = { workspace = true, optional = true }

[target.'cfg(target_family = "wasm")'.dependencies]
libsecp256k1 = { version = "0.7.0" }
libsecp256k1 = { version = "0.7.0", default-features = false, features = ["hmac"] }

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

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

[dev-dependencies]
rand_core = { workspace = true }
proptest = "1.6.0"

[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3", features = ["fileapi", "processenv", "winnt"] }

[build-dependencies]
toml = { workspace = true }

[features]
default = ["developer-mode"]
default = ["developer-mode", "ctrlc-handler", "rand"]
developer-mode = []
# Enables graceful shutdown handling for Ctrl+C (SIGINT) signals.
# This pulls in the `nix` or `winapi` dependency.
ctrlc-handler = ["dep:nix", "dep:winapi"]
slog_json = ["slog-json"]
rusqlite = ["dep:rusqlite"]
testing = []
rusqlite = ["dep:rusqlite", "rand"]
# Enables the rand module. This flag must be off on deterministic
# platforms such as CosmWasm
rand = ["dep:rand"]
serde = []
testing = ["rand"]
bech32_std = []
bech32_strict = []

[build-dependencies]
toml = "0.5.6"

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

[target.'cfg(any(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")), any(target_os="windows")))'.dependencies]
sha2 = { version = "0.10" }
# Wasm-specific features for easier configuration
wasm-web = ["rand", "getrandom/js", "libsecp256k1/static-context"]
wasm-deterministic = ["getrandom/custom"]
3 changes: 0 additions & 3 deletions stacks-common/src/deps_common/bitcoin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
//! software.
//!

// Clippy flags
#![allow(clippy::needless_range_loop)] // suggests making a big mess of array newtypes

// Coding conventions
#![deny(non_upper_case_globals)]
#![deny(non_camel_case_types)]
Expand Down
Loading
Loading