From fee860bf59520f76a7655b6b064556829656212f Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Sun, 17 Oct 2021 17:56:39 -0700 Subject: [PATCH] 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. (cherry picked from commit 66f2f0398dbb17d5c3a19ee03a747078e077200c) Signed-off-by: Oliver Gould --- linkerd/app/inbound/fuzz/Cargo.toml | 1 + linkerd/app/inbound/src/http/router.rs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/linkerd/app/inbound/fuzz/Cargo.toml b/linkerd/app/inbound/fuzz/Cargo.toml index 8e1c030581..3f7136287b 100644 --- a/linkerd/app/inbound/fuzz/Cargo.toml +++ b/linkerd/app/inbound/fuzz/Cargo.toml @@ -18,6 +18,7 @@ http = "0.2" linkerd-app-core = { path = "../../core" } linkerd-app-inbound = { path = ".." } linkerd-app-test = { path = "../../test" } +linkerd-proxy-identity = { path = "../../../proxy/identity", features = ["test-util"] } linkerd-tracing = { path = "../../../tracing", features = ["ansi"] } tracing = "0.1" diff --git a/linkerd/app/inbound/src/http/router.rs b/linkerd/app/inbound/src/http/router.rs index 0dd99b4293..961fcbd771 100644 --- a/linkerd/app/inbound/src/http/router.rs +++ b/linkerd/app/inbound/src/http/router.rs @@ -116,7 +116,13 @@ impl Inbound { rt.span_sink.clone(), super::trace_labels(), )) - .push_on_service(http::BoxResponse::layer()); + .push_on_service(svc::layers() + .push(http::BoxResponse::layer()) + // This box is needed to reduce compile times on recent (2021-10-17) nightlies, + // though this may be fixed by https://github.com/rust-lang/rust/pull/89831. It + // should be removed when possible. + .push(svc::BoxService::layer()) + ); // Attempts to discover a service profile for each logical target (as // informed by the request's headers). The stack is cached until a