Skip to content

Regression of applier build times in Rust 1.57 #746

@nightkr

Description

@nightkr

Current and expected behavior

1.57 behaviour

  1. Check out https://gitlab.com/teozkr/repros/-/tree/kube/rs1.57-compile-regression.
  2. rustup update 1.57.0
  3. cargo +1.57.0 build
  4. Note that the full build gets stuck for several minutes on rs157-compile-regression(bin)
  5. touch src/main.rs
  6. cargo +1.57.0 build
  7. Note that the incremental build takes ~40s (on my machine, scale to yours)

1.56 behaviour

  1. rustup update 1.56.1
  2. cargo +1.56.1 build
  3. Note that the full build completes in ~30s (on my machine, scale to yours)
  4. touch src/main.rs
  5. cargo +1.56.1 build
  6. Note that the incremental build takes ~3s (on my machine, scale to yours)

Possible solution

More of a workaround, but boxing queue:

diff --git a/src/main.rs b/src/main.rs
index a306bba..6e08d03 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -25,7 +25,8 @@ async fn main() {
                 stream::empty::<Result<watcher::Event<ConfigMap>, watcher::Error>>(),
             )),
             (),
-        ),
+        )
+        .boxed(),
     )
     .boxed()
     .for_each(|_| async {})

brings the incremental rebuild time down to ~4s.

Additional context

No response

Environment

Arch Linux
Rustc 1.57 (bad), 1.56.1 (good)
K8s cluster is irrelevant since this is a build issue

Configuration and features

kube = { version = "0.64.0", features = ["runtime"] }
k8s-openapi = { version = "0.13.1", features = ["v1_22"] }

Affected crates

kube-runtime

Would you like to work on fixing this bug?

yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmsrvrelated to minimum supported rust versionruntimecontroller runtime related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions