From a683d78ed023a8444db6d54addb61b8c3aab8f14 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Mon, 13 Sep 2021 19:58:06 +0200 Subject: [PATCH 1/2] git: ensure we are using the correct shell binary for tests Previosuly the test scripts used /bin/sh which is a bit of an impurity. It is mostly well-behaved but it essentially leaks the hosts state into the build as /bin/sh points to some minimal shell implementation configured on the host OS. By patching the shebgangs of all the test scripts in the test folder (t/*.sh) we can make sure that those run with the correct shell binary. This was found as part of a random build failure of gitMinimal in response to the systemd v249 PR being merged [0]. Since we have to somehow touch the hash of the derivation to make the build failure go away we might as well fix the hardcoded /bin/sh issue. [0] https://github.com/NixOS/nixpkgs/commit/64556974b6674338a227d559975c9b4710f6e751#commitcomment-56385360 --- .../version-management/git-and-tools/git/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 1d02adc6397e..36a09c77d765 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -65,6 +65,9 @@ stdenv.mkDerivation { # Fix references to gettext introduced by ./git-sh-i18n.patch substituteInPlace git-sh-i18n.sh \ --subst-var-by gettext ${gettext} + + # ensure we are using the correct shell when executing the test scripts + patchShebangs t/*.sh ''; nativeBuildInputs = [ gettext perlPackages.perl makeWrapper ] From 6f3ee459deac73b6d509b6e74a0fb0df78612d57 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 14 Sep 2021 11:21:53 +0200 Subject: [PATCH 2/2] git: disable flaky test 6421-merge-partial-clone Occasionally the test fails for unknown reasons but works as soon as we change the derivation in any way. For now it is better to not have a test that is flaky than having a test that occasionally breaks and continously wastes time on debugging it. This was found as part of a random build failure of gitMinimal in response to the systemd v249 PR being merged [0]. [0] https://github.com/NixOS/nixpkgs/commit/64556974b6674338a227d559975c9b4710f6e751#commitcomment-56385360 --- .../version-management/git-and-tools/git/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 36a09c77d765..9c9fa6032c6c 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -321,6 +321,7 @@ stdenv.mkDerivation { # Flaky tests: disable_test t5319-multi-pack-index + disable_test t6421-merge-partial-clone ${lib.optionalString (!perlSupport) '' # request-pull is a Bash script that invokes Perl, so it is not available