From 6f1d15bd1a85aed635a64bd85c1a87467ef5132d Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 27 Jan 2025 14:14:33 -0600 Subject: [PATCH] nix: build flake checks in `test` profile Overall, building in the test profile should significantly speed up the overall build pipeline because so many less cycles are spent (on GHA runners that are certainly at high load). The goal here is to help reduce CI flake outs due to things timing out; I suspect part of the problem may be a lot of the ~15 minute time limit being used up just compiling things. This is a partial revert of b714592952400ab, which removed this previous override of the Flake `checks`. Signed-off-by: Austin Seipp --- flake.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 4d36c66ab..db22914c0 100644 --- a/flake.nix +++ b/flake.nix @@ -100,7 +100,6 @@ }; in { formatter = pkgs.alejandra; - checks.jujutsu = self.packages.${system}.jujutsu; packages = { jujutsu = rustMinimalPlatform.buildRustPackage { @@ -150,6 +149,21 @@ default = self.packages.${system}.jujutsu; }; + checks.jujutsu = self.packages.${system}.jujutsu.overrideAttrs ({...}: { + # The default Rust infrastructure runs all builds in the release + # profile, which is significantly slower. Run this under the `test` + # profile instead, which matches all our other CI systems, Cargo, etc. + cargoBuildType = "test"; + cargoCheckType = "test"; + + # By default, `flake check` will want to run the install phase, but + # because we override the cargoBuildType, it fails to find the proper + # binary. But we don't even care about the binary or even the buildPhase + # in this case; just remove them both. + buildPhase = "true"; + installPhase = "touch $out"; + }); + devShells.default = let packages = with pkgs; [ rustShellToolchain