Skip to content

Commit 20d3b73

Browse files
LucioFrancobobrik
authored andcommitted
chore(examples): Add tower feature back to make udeps happy (hyperium#2432)
Reference hyperium#2431 --------- Co-authored-by: Ivan Babrou <[email protected]>
1 parent 999603e commit 20d3b73

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

examples/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ h2c = ["dep:hyper", "dep:tower", "dep:http", "dep:hyper-util"]
273273
cancellation = ["dep:tokio-util"]
274274

275275
full = ["gcp", "routeguide", "reflection", "autoreload", "health", "grpc-web", "tracing", "uds", "streaming", "mock", "json-codec", "compression", "tls", "tls-rustls", "tls-client-auth", "types", "cancellation", "h2c"]
276+
tower = ["dep:tower", "dep:http"]
276277
default = ["full"]
277278

278279
[dependencies]

flake.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,39 @@
100100
${config.pre-commit.installationScript}
101101
'';
102102
};
103+
104+
# App for running the full CI udeps check
105+
# `nix run .#udeps-ci`
106+
apps.udeps-ci = {
107+
type = "app";
108+
program = "${pkgs.writeShellScript "udeps-ci" ''
109+
set -e
110+
export PATH="${pkgs.rustup}/bin:${pkgs.cargo-udeps}/bin:${pkgs.cargo-hack}/bin:$PATH"
111+
112+
# Ensure nightly toolchain is installed
113+
if ! rustup toolchain list | grep -q "nightly-2025-03-27"; then
114+
echo "Installing nightly-2025-03-27 toolchain..."
115+
rustup toolchain install nightly-2025-03-27
116+
fi
117+
118+
# Set the toolchain for this run
119+
export RUSTUP_TOOLCHAIN=nightly-2025-03-27
120+
121+
echo "Running cargo hack udeps..."
122+
cargo hack udeps --workspace --exclude-features=_tls-any,tls,tls-aws-lc,tls-ring,tls-connect-info --each-feature
123+
124+
echo "Running tonic TLS feature checks..."
125+
cargo udeps --package tonic --features tls-ring,transport
126+
cargo udeps --package tonic --features tls-ring,server
127+
cargo udeps --package tonic --features tls-ring,channel
128+
cargo udeps --package tonic --features tls-aws-lc,transport
129+
cargo udeps --package tonic --features tls-aws-lc,server
130+
cargo udeps --package tonic --features tls-aws-lc,channel
131+
cargo udeps --package tonic --features tls-connect-info
132+
133+
echo "✓ All udeps checks passed!"
134+
''}";
135+
};
103136
};
104137
};
105138
}

grpc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ _runtime-tokio = [
2727
"dep:socket2",
2828
"dep:tower",
2929
]
30+
# Used for testing with udeps as it wants this feature to exist
31+
# to be able to do its checks.
32+
tower = ["_runtime-tokio"]
3033

3134
[dependencies]
3235
bytes = "1.10.1"

0 commit comments

Comments
 (0)