Skip to content

Commit

Permalink
Add a 'rustfmt' feature to crates that use gRPC (#1041)
Browse files Browse the repository at this point in the history
Sometimes we need to be able to read generated code. The
linkerd2-proxy-api's 'rustfmt' feature flag makes this behavior
optional. This change adds this feature flag to the linkerd crates that
depend on linkerd2-proxy-api.
  • Loading branch information
olix0r authored Jun 10, 2021
1 parent 8119772 commit aabd5a5
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,7 @@ dependencies = [
"linkerd-trace-context",
"linkerd-tracing",
"linkerd-transport-header",
"linkerd2-proxy-api",
"pin-project",
"prost-types",
"regex",
"serde_json",
"thiserror",
Expand Down
5 changes: 0 additions & 5 deletions linkerd/app/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ linkerd-metrics = { path = "../../metrics" }
linkerd-transport-header = { path = "../../transport-header" }
linkerd-opencensus = { path = "../../opencensus" }
linkerd-proxy-core = { path = "../../proxy/core" }
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", branch = "main" }
linkerd-proxy-api-resolve = { path = "../../proxy/api-resolve" }
linkerd-proxy-discover = { path = "../../proxy/discover" }
linkerd-proxy-identity = { path = "../../proxy/identity" }
Expand Down Expand Up @@ -83,7 +82,3 @@ features = [

[target.'cfg(target_os = "linux")'.dependencies]
linkerd-system = { path = "../../system" }

[dev-dependencies]
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", branch = "main", features = ["arbitrary"] }
prost-types = "0.7.0"
1 change: 0 additions & 1 deletion linkerd/app/inbound/fuzz/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ dependencies = [
"linkerd-trace-context",
"linkerd-tracing",
"linkerd-transport-header",
"linkerd2-proxy-api",
"pin-project",
"regex",
"serde_json",
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ a dedicated crate to help the compiler cache dependencies properly.
"""

[features]
# Disable to skip certain tests that should not be run on CI.
flaky_tests = []
flaky_tests = [] # Disable to skip certain tests that should not be run on CI.
rustfmt = ["linkerd2-proxy-api/rustfmt"]

[dependencies]
bytes = "1"
Expand Down
3 changes: 3 additions & 0 deletions linkerd/proxy/api-resolve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ description = """
Implements the Resolve trait using the proxy's gRPC API
"""

[features]
rustfmt = ["linkerd2-proxy-api/rustfmt"]

[dependencies]
async-stream = "0.3"
futures = { version = "0.3", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions linkerd/proxy/identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ license = "Apache-2.0"
edition = "2018"
publish = false

[features]
rustfmt = ["linkerd2-proxy-api/rustfmt"]

[dependencies]
futures = { version = "0.3", default-features = false }
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", branch = "main", features = ["identity", "client"] }
Expand Down
3 changes: 3 additions & 0 deletions linkerd/proxy/tap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ license = "Apache-2.0"
edition = "2018"
publish = false

[features]
rustfmt = ["linkerd2-proxy-api/rustfmt"]

[dependencies]
http = "0.2"
hyper = { version = "0.14.2", features = ["http1", "http2"] }
Expand Down
3 changes: 3 additions & 0 deletions linkerd/service-profiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ description = """
Implements client layers for Linkerd ServiceProfiles.
"""

[features]
rustfmt = ["linkerd2-proxy-api/rustfmt"]

[dependencies]
bytes = "1"
futures = { version = "0.3", default-features = false }
Expand Down

0 comments on commit aabd5a5

Please sign in to comment.