From f2948ee4791705b9e3bae423d6a45c2415d053f6 Mon Sep 17 00:00:00 2001 From: DavHau Date: Thu, 1 May 2025 14:30:50 +0700 Subject: [PATCH] git: fix checks by limiting build cores building git on a 96 core machine fails during installCheckPhase Even when limiting to 48 cores, it still fails. 32 cores seem to work. Error on too many cores: ``` git> Test Summary Report git> ------------------- git> t7002-mv-sparse-checkout.sh (Wstat: 256 (exited 1) Tests: 22 Failed: 1) git> Failed test: 7 git> Non-zero exit status: 1 git> t5319-multi-pack-index.sh (Wstat: 256 (exited 1) Tests: 93 Failed: 1) git> Failed test: 11 git> Non-zero exit status: 1 git> t5515-fetch-merge-logic.sh (Wstat: 256 (exited 1) Tests: 65 Failed: 1) git> Failed test: 31 git> Non-zero exit status: 1 git> t7513-interpret-trailers.sh (Wstat: 256 (exited 1) Tests: 99 Failed: 1) git> Failed test: 66 git> Non-zero exit status: 1 git> Files=1016, Tests=30358, 87 wallclock secs ( 6.47 usr 3.63 sys + 219.99 cusr 2407.64 csys = 2637.73 CPU) git> Result: FAIL git> make[1]: *** [Makefile:73: prove] Error 1 git> make[1]: Leaving directory '/build/git-2.49.0/t' git> make: *** [Makefile:3274: test] Error 2 ``` --- pkgs/applications/version-management/git/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index e79f78a7dab5..64b9fac196c0 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -456,6 +456,12 @@ stdenv.mkDerivation (finalAttrs: { preInstallCheck = '' + # Some tests break with high concurrency + # https://github.com/NixOS/nixpkgs/pull/403237 + if ((NIX_BUILD_CORES > 32)); then + NIX_BUILD_CORES=32 + fi + installCheckFlagsArray+=( GIT_PROVE_OPTS="--jobs $NIX_BUILD_CORES --failures --state=failed,save" GIT_TEST_INSTALLED=$out/bin