diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e24616f6e..60fb69a576 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,6 +112,13 @@ jobs: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse ASYNC_STD_THREAD_COUNT: 4 + - name: Check for feature leaks + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions-rs/cargo@v1 + with: + command: nextest + args: run -p zenohd --no-default-features + - name: Run doctests uses: actions-rs/cargo@v1 with: diff --git a/zenohd/Cargo.toml b/zenohd/Cargo.toml index b28a28331b..754198dc73 100644 --- a/zenohd/Cargo.toml +++ b/zenohd/Cargo.toml @@ -26,6 +26,7 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] +default = ["zenoh/default"] shared-memory = ["zenoh/shared-memory"] [dependencies] @@ -37,7 +38,7 @@ git-version = { workspace = true } json5 = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } -zenoh = { workspace = true, default-features = true, features = ["unstable"] } +zenoh = { workspace = true, features = ["unstable"] } [dev-dependencies] rand = { workspace = true, features = ["default"] } diff --git a/zenohd/src/main.rs b/zenohd/src/main.rs index eef8432775..cc28234e74 100644 --- a/zenohd/src/main.rs +++ b/zenohd/src/main.rs @@ -309,6 +309,7 @@ fn config_from_args(args: &ArgMatches) -> Config { } #[test] +#[cfg(feature = "default")] fn test_default_features() { assert_eq!(zenoh::FEATURES, concat!( " zenoh/auth_pubkey", @@ -328,4 +329,27 @@ fn test_default_features() { " zenoh/unstable", " zenoh/default", )); +} + +#[test] +#[cfg(not(feature = "default"))] +fn test_no_default_features() { + assert_eq!(zenoh::FEATURES, concat!( + // " zenoh/auth_pubkey", + // " zenoh/auth_usrpwd", + // " zenoh/complete_n", + // " zenoh/shared-memory", + // " zenoh/stats", + // " zenoh/transport_multilink", + // " zenoh/transport_quic", + // " zenoh/transport_serial", + // " zenoh/transport_unixpipe", + // " zenoh/transport_tcp", + // " zenoh/transport_tls", + // " zenoh/transport_udp", + // " zenoh/transport_unixsock-stream", + // " zenoh/transport_ws", + " zenoh/unstable", + // " zenoh/default", + )); } \ No newline at end of file