Skip to content

Commit

Permalink
nix: build flake checks in test profile
Browse files Browse the repository at this point in the history
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 b714592, which removed this previous
override of the Flake `checks`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
  • Loading branch information
thoughtpolice committed Jan 29, 2025
1 parent 6fd30ec commit 83c3ac4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
};
in {
formatter = pkgs.alejandra;
checks.jujutsu = self.packages.${system}.jujutsu;

packages = {
jujutsu = rustMinimalPlatform.buildRustPackage {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 83c3ac4

Please sign in to comment.