Skip to content

Commit

Permalink
Fixed subtle problem related to default-features and additivity when …
Browse files Browse the repository at this point in the history
…using workspace dependencies
  • Loading branch information
davidedellagiustina committed Jan 12, 2023
1 parent a944b68 commit 27ccf14
Show file tree
Hide file tree
Showing 28 changed files with 67 additions and 64 deletions.
21 changes: 12 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ license = " EPL-2.0 OR Apache-2.0"
categories = ["network-programming"]
description = "Zenoh: Zero Overhead Pub/sub, Store/Query and Compute."

# DEFAULT-FEATURES NOTE: Be careful with default-features and additivity!
# (https://github.com/rust-lang/cargo/issues/11329)
[workspace.dependencies]
aes = "0.8.2"
anyhow = "1.0.66"
anyhow = { version = "1.0.66", default-features = false } # Default features are disabled due to usage in no_std crates
async-executor = "1.5.0"
async-global-executor = "2.3.1"
async-rustls = "0.3.0"
async-std = "=1.12.0"
async-std = { version = "=1.12.0", default-features = false } # Default features are disabled due to some crates' requirements
async-trait = "0.1.60"
base64 = "0.21.0"
bincode = "1.3.3"
Expand All @@ -85,9 +87,9 @@ event-listener = "2.5.3"
flume = "0.10.14"
form_urlencoded = "1.1.0"
futures = "0.3.25"
futures-util = "0.3.25"
futures-util = { version = "0.3.25", default-features = false } # Default features are disabled due to some crates' requirements
git-version = "0.3.5"
hex = "0.4.3"
hex = { version = "0.4.3", default-features = false } # Default features are disabled due to usage in no_std crates
hmac = { version = "0.12.1", features = ["std"] }
home = "0.5.4"
http-types = "2.12.0"
Expand All @@ -108,7 +110,7 @@ pnet_datalink = "0.31.0"
proc-macro2 = "1.0.47"
quinn = "0.9.3"
quote = "1.0.21"
rand = "0.8.5"
rand = { version = "0.8.5", default-features = false } # Default features are disabled due to usage in no_std crates
rand_chacha = "0.3.1"
rcgen = "0.10.0"
regex = "1.7.0"
Expand All @@ -118,7 +120,7 @@ rustc_version = "0.4.0"
rustls = "0.20.6"
rustls-native-certs = "0.6.2"
rustls-pemfile = "1.0.1"
serde = { version = "1.0.152", features = ["derive"] }
serde = { version = "1.0.152", default-features = false, features = ["derive"] } # Default features are disabled due to usage in no_std crates
serde_json = "1.0.89"
serde_yaml = "0.9.14"
sha3 = "0.10.6"
Expand All @@ -128,14 +130,15 @@ socket2 = "0.4.7"
stop-token = "0.7.0"
syn = "1.0.105"
tide = "0.16.0"
tokio = "1.23.1"
tokio = { version = "1.23.1", default-features = false } # Default features are disabled due to some crates' requirements
tokio-tungstenite = "0.18.0"
typenum = "1.15.0"
uhlc = { git = "https://github.com/atolab/uhlc-rs.git" } # TODO: Using github source until the no_std update gets released on crates.io
uhlc = { git = "https://github.com/atolab/uhlc-rs.git", default-features = false } # TODO: Using github source until the no_std update gets released on crates.io
# Default features are disabled due to usage in no_std crates
unzip-n = "0.1.2"
url = "2.3.1"
urlencoding = "2.1.2"
uuid = { version = "1.2.2", features = ["v4"] }
uuid = { version = "1.2.2", default-features = false, features = ["v4"] } # Default features are disabled due to usage in no_std crates
validated_struct = "2.1.0"
vec_map = "0.8.2"
webpki = "0.22.0"
Expand Down
6 changes: 3 additions & 3 deletions commons/zenoh-codec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ defmt = [
]

[dependencies]
uhlc = { workspace = true, default-features = false }
uhlc = { workspace = true }
zenoh-buffers = { path = "../zenoh-buffers/", default-features = false }
zenoh-protocol = { path = "../zenoh-protocol/", default-features = false }
zenoh-shm = { path = "../zenoh-shm/", optional = true }

[dev-dependencies]
criterion = { workspace = true }
rand = { workspace = true }
uuid = { workspace = true }
rand = { workspace = true, default-features = true }
uuid = { workspace = true, default-features = true }
zenoh-protocol = { path = "../zenoh-protocol/", features = ["test"] }

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ description = "Internal crate for zenoh."
flume = { workspace = true }
json5 = { workspace = true }
num_cpus = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
validated_struct = { workspace = true, features = ["json5", "json_get"] }
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true }
async-std = { workspace = true, default-features = true }
lazy_static = { workspace = true }
zenoh-macros = { path = "../zenoh-macros/" }
2 changes: 1 addition & 1 deletion commons/zenoh-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ description = "Internal crate for zenoh."
[dependencies]
aes = { workspace = true }
hmac = { workspace = true }
rand = { workspace = true }
rand = { workspace = true, default-features = true }
rand_chacha = { workspace = true }
sha3 = { workspace = true }
zenoh-result = { path = "../zenoh-result/" }
10 changes: 5 additions & 5 deletions commons/zenoh-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ defmt = [

[dependencies]
defmt = { workspace = true, optional = true }
hex = { workspace = true, default-features = false, features = ["alloc"] }
rand = { workspace = true, default-features = false, features = ["alloc", "getrandom"], optional = true }
serde = { workspace = true, default-features = false, features = ["alloc"] }
uhlc = { workspace = true, default-features = false }
uuid = { workspace = true, default-features = false } # Needs a getrandom::getrandom() custom implementation on embedded (in root crate)
hex = { workspace = true, features = ["alloc"] }
rand = { workspace = true, features = ["alloc", "getrandom"], optional = true }
serde = { workspace = true, features = ["alloc"] }
uhlc = { workspace = true }
uuid = { workspace = true } # Needs a getrandom::getrandom() custom implementation on embedded (in root crate)
zenoh-buffers = { path = "../zenoh-buffers/", default-features = false }
zenoh-result = { path = "../zenoh-result/", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-result/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ std = ["anyhow/std"]
defmt = ["dep:defmt"]

[dependencies]
anyhow = { workspace = true, default-features = false }
anyhow = { workspace = true }
defmt = { workspace = true, optional = true }
2 changes: 1 addition & 1 deletion commons/zenoh-shm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ description = "Internal crate for zenoh."
[dependencies]
bincode = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
shared_memory = { workspace = true }
zenoh-buffers = { path = "../zenoh-buffers/" }
zenoh-result = { path = "../zenoh-result/" }
6 changes: 3 additions & 3 deletions commons/zenoh-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, features = ["unstable"] }
async-std = { workspace = true, default-features = true, features = ["unstable"] }
event-listener = { workspace = true }
flume = { workspace = true }
futures = { workspace = true }
tokio = { workspace = true, features = ["sync"] }
tokio = { workspace = true, default-features = true, features = ["sync"] }
zenoh-buffers = { path = "../zenoh-buffers/" }
zenoh-collections = { path = "../zenoh-collections/" }
zenoh-core = { path = "../zenoh-core/" }

[dev-dependencies]
async-std = { workspace = true, features = ["unstable", "attributes"] }
async-std = { workspace = true, default-features = true, features = ["unstable", "attributes"] }
4 changes: 2 additions & 2 deletions commons/zenoh-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ compat = [
]

[dependencies]
async-std = { workspace = true }
async-std = { workspace = true, default-features = true }
async-trait = { workspace = true }
clap = { workspace = true }
flume = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
hex = { workspace = true, default-features = true }
home = { workspace = true }
humantime = { workspace = true }
lazy_static = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ readme = "README.md"
shared-memory = ["zenoh/shared-memory"]

[dependencies]
async-std = { workspace = true, default-features = false, features = ["attributes"] }
async-std = { workspace = true, features = ["attributes"] }
clap = { workspace = true }
env_logger = { workspace = true }
flume = { workspace = true }
Expand All @@ -41,7 +41,7 @@ zenoh = { path = "../zenoh/", default-features = false }
zenoh-ext = { path = "../zenoh-ext/" }

[dev-dependencies]
rand = { workspace = true }
rand = { workspace = true, default-features = true }

[build-dependencies]
rustc_version = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions io/zenoh-link-commons/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
flume = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
typenum = { workspace = true }
zenoh-buffers = { path = "../../commons/zenoh-buffers/" }
zenoh-cfg-properties = { path = "../../commons/zenoh-cfg-properties/" }
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-link/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ transport_ws = ["zenoh-link-ws"]
transport_serial = ["zenoh-link-serial"]

[dependencies]
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
rcgen = { workspace = true, optional = true }
zenoh-cfg-properties = { path = "../../commons/zenoh-cfg-properties/" }
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-links/zenoh-link-quic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false, features = ["unstable", "tokio1"] }
async-std = { workspace = true, features = ["unstable", "tokio1"] }
async-trait = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions io/zenoh-links/zenoh-link-serial/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false, features = ["unstable", "tokio1"] }
async-std = { workspace = true, features = ["unstable", "tokio1"] }
async-trait = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
tokio = { workspace = true, default-features = false, features = ["io-std", "macros", "net", "rt-multi-thread", "time", "io-util"] }
uuid = { workspace = true }
tokio = { workspace = true, features = ["io-std", "macros", "net", "rt-multi-thread", "time", "io-util"] }
uuid = { workspace = true, default-features = true }
z-serial = { workspace = true }
zenoh-cfg-properties = { path = "../../../commons/zenoh-cfg-properties/" }
zenoh-collections = { path = "../../../commons/zenoh-collections/" }
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-links/zenoh-link-tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
log = { workspace = true }
zenoh-core = { path = "../../../commons/zenoh-core/" }
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-links/zenoh-link-tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description = "Internal crate for zenoh."

[dependencies]
async-rustls = { workspace = true }
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-links/zenoh-link-udp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
log = { workspace = true }
socket2 = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions io/zenoh-links/zenoh-link-unixsock_stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
nix = { workspace = true }
uuid = { workspace = true }
uuid = { workspace = true, default-features = true }
zenoh-core = { path = "../../../commons/zenoh-core/" }
zenoh-link-commons = { path = "../../zenoh-link-commons/" }
zenoh-protocol = { path = "../../../commons/zenoh-protocol/" }
Expand Down
6 changes: 3 additions & 3 deletions io/zenoh-links/zenoh-link-ws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { workspace = true, default-features = false, features = ["unstable", "tokio1"] }
async-std = { workspace = true, features = ["unstable", "tokio1"] }
async-trait = { workspace = true }
futures-util = { workspace = true, default-features = false, features = ["sink", "std"] }
futures-util = { workspace = true, features = ["sink", "std"] }
log = { workspace = true }
tokio = { workspace = true, default-features = false, features = ["io-std", "macros", "net", "rt-multi-thread", "time"] }
tokio = { workspace = true, features = ["io-std", "macros", "net", "rt-multi-thread", "time"] }
tokio-tungstenite = { workspace = true }
url = { workspace = true }
zenoh-core = { path = "../../../commons/zenoh-core/" }
Expand Down
6 changes: 3 additions & 3 deletions io/zenoh-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ stats = []
[dependencies]
async-executor = { workspace = true }
async-global-executor = { workspace = true }
async-std = { workspace = true, default-features = false }
async-std = { workspace = true }
async-trait = { workspace = true }
flume = { workspace = true }
log = { workspace = true }
paste = { workspace = true }
rand = { workspace = true }
rand = { workspace = true, default-features = true }
ringbuffer-spsc = { workspace = true }
rsa = { workspace = true, optional = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
zenoh-buffers = { path = "../../commons/zenoh-buffers/" }
zenoh-cfg-properties = { path = "../../commons/zenoh-cfg-properties/" }
zenoh-codec = { path = "../../commons/zenoh-codec/" }
Expand Down
2 changes: 1 addition & 1 deletion plugins/example-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ name = "zplugin_example"
crate-type = ["cdylib"]

[dependencies]
async-std = { workspace = true }
async-std = { workspace = true, default-features = true }
clap = { workspace = true }
env_logger = { workspace = true }
futures = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion plugins/zenoh-backend-traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ description = "Zenoh: traits to be implemented by backends libraries"
maintenance = { status = "actively-developed" }

[dependencies]
async-std = { workspace = true }
async-std = { workspace = true, default-features = true }
async-trait = { workspace = true }
derive_more = { workspace = true }
serde_json = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions plugins/zenoh-plugin-rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ name = "zplugin_rest"
crate-type = ["cdylib", "rlib"]

[dependencies]
anyhow = { workspace = true }
async-std = { workspace = true }
anyhow = { workspace = true, default-features = true }
async-std = { workspace = true, default-features = true }
base64 = { workspace = true }
clap = { workspace = true }
env_logger = { workspace = true }
Expand All @@ -43,7 +43,7 @@ git-version = { workspace = true }
http-types = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
serde_json = { workspace = true }
tide = { workspace = true }
zenoh = { path = "../../zenoh/", default-features = false, features = [ "unstable" ] }
Expand Down
4 changes: 2 additions & 2 deletions plugins/zenoh-plugin-storage-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ name = "zplugin_storage_manager"
crate-type = ["cdylib", "rlib"]

[dependencies]
async-std = { workspace = true }
async-std = { workspace = true, default-features = true }
async-trait = { workspace = true }
clap = { workspace = true }
crc = { workspace = true }
Expand All @@ -49,7 +49,7 @@ git-version = { workspace = true }
lazy_static = { workspace = true }
libloading = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
serde_json = { workspace = true }
urlencoding = { workspace = true }
zenoh = { path = "../../zenoh/", default-features = false, features = [ "unstable" ] }
Expand Down
4 changes: 2 additions & 2 deletions zenoh-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ unstable = []
default = []

[dependencies]
async-std = { workspace = true, default-features = false, features = ["attributes", "unstable"] }
async-std = { workspace = true, features = ["attributes", "unstable"] }
bincode = { workspace = true }
env_logger = { workspace = true }
flume = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, default-features = true }
zenoh = { path = "../zenoh/", default-features = false, features = ["unstable"] }
zenoh-core = { path = "../commons/zenoh-core/" }
zenoh-result = { path = "../commons/zenoh-result/" }
Expand Down
Loading

0 comments on commit 27ccf14

Please sign in to comment.