Skip to content

Commit 66f2f03

Browse files
authored
inbound: Add a box layer to reduce compile times (#1317)
The inbound proxy builds in 30-40 minutes on recent nightlies. This can be reduced to 3-4 minutes with a boxing layer. This change adds such a layer so that fuzzing builds can complete in a timely fashion.
1 parent 504d8be commit 66f2f03

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

linkerd/app/inbound/fuzz/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ http = "0.2"
1818
linkerd-app-core = { path = "../../core" }
1919
linkerd-app-inbound = { path = ".." }
2020
linkerd-app-test = { path = "../../test" }
21+
linkerd-proxy-identity = { path = "../../../proxy/identity", features = ["test-util"] }
2122
linkerd-tracing = { path = "../../../tracing", features = ["ansi"] }
2223
tracing = "0.1"
2324

linkerd/app/inbound/src/http/router.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ impl<C> Inbound<C> {
116116
rt.span_sink.clone(),
117117
super::trace_labels(),
118118
))
119-
.push_on_service(http::BoxResponse::layer());
119+
.push_on_service(svc::layers()
120+
.push(http::BoxResponse::layer())
121+
// This box is needed to reduce compile times on recent (2021-10-17) nightlies,
122+
// though this may be fixed by https://github.com/rust-lang/rust/pull/89831. It
123+
// should be removed when possible.
124+
.push(svc::BoxService::layer())
125+
);
120126

121127
// Attempts to discover a service profile for each logical target (as
122128
// informed by the request's headers). The stack is cached until a

linkerd/app/inbound/src/test_util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use linkerd_app_core::{
66
drain, exp_backoff, metrics,
77
proxy::{
88
http::{h1, h2},
9+
identity::LocalCrtKey,
910
tap,
1011
},
1112
transport::{Keepalive, ListenAddr},
@@ -73,7 +74,7 @@ pub fn runtime() -> (ProxyRuntime, drain::Signal) {
7374
let (tap, _) = tap::new();
7475
let (metrics, _) = metrics::Metrics::new(std::time::Duration::from_secs(10));
7576
let runtime = ProxyRuntime {
76-
identity: linkerd_proxy_identity::LocalCrtKey::default_for_test(),
77+
identity: LocalCrtKey::default_for_test(),
7778
metrics: metrics.proxy,
7879
tap,
7980
span_sink: None,

0 commit comments

Comments
 (0)