From 7240c148f47e15ea14ecc97f7ebe0d0bb67ee848 Mon Sep 17 00:00:00 2001 From: maia Date: Mon, 30 Nov 2026 20:42:47 +0100 Subject: [PATCH] public-cache: build and push the cargo dependency closures --- .forgejo/workflows/public-cache.yml | 4 +++- nix/packages/default.nix | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/public-cache.yml b/.forgejo/workflows/public-cache.yml index 17d5ee007..e7e50ded1 100644 --- a/.forgejo/workflows/public-cache.yml +++ b/.forgejo/workflows/public-cache.yml @@ -21,9 +21,11 @@ jobs: runs-on: nixos steps: - uses: actions/checkout@v3 - - name: build the deployed closures + - name: build the deployed closures and the cargo dependencies they build from run: | nix build \ + .#cargo-deps \ + .#cargo-deps-bin \ .#default \ .#swarm-controller \ .#swarmctl \ diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 652ec24cd..9b5416baa 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -299,6 +299,14 @@ in # is exposed too since it's independently useful/inspectable. inherit swagger-ui-dist swagger-ui-theme; + # The crane dependency builds the Rust packages and checks start from, as + # outputs of their own so the public cache job can build and push them: + # without them a consumer of the cache recompiles every crate dependency. + # `cargo-deps-bin` is what the deployed binaries build from (no test + # targets), `cargo-deps` what the checks build from. Neither is in `default`. + cargo-deps = rust.cargoArtifacts; + cargo-deps-bin = rust.cargoArtifactsBinOnly; + # `vale` preconfigured with .vale.ini and the pinned style packages # (./vale.nix, ./vale-styles.nix); the prose-lint CI jobs and the devshell run it. vale = pkgs.callPackage ./vale.nix { };