nixpkgs/pkgs/applications/version-management/git-and-tools
Ruud van Asseldonk 2163fc7f0a git: fix the "perlSupport = false" configuration
When perlSupport = false, we will set NO_PERL=1, and build Git without
Perl support. This is a build option that Git supports. However, Git's
test suite still requires a Perl to be available to run the tests, and
we did not provide one. The tests respect PERL_PATH, and if it is not
set, they default to /usr/bin/perl.

Before this commit, if we set "perlSupport = false", then no Perl would
be available to the package, and so the tests would default to
/usr/bin/perl. When building without a sandbox, that could still work,
even though there is no "perl" on the path, because the tests defaulted
to an absolute path.

You can reproduce this issue as follows:

    nix-build -E 'let pkgs = (import ./default.nix) {}; in pkgs.git.override { perlSupport = false; }'

I just ran into this when trying to build pkgs.git from an old version
of Nixpkgs that I was able to build just fine in the past, and today it
would not build any more, complaining when running the tests:

    make -C t/ all
    make[1]: Entering directory '/build/git-2.18.0/t'
    rm -f -r 'test-results'
    /nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash: /usr/bin/perl: No such file or directory

In the past the sandbox was not enabled by default, so then it worked
for me. But now that it is enabled, my host's (not NixOS) /usr/bin/perl
is no longer accessible, and the build fails.

The solution is to explicitly set PERL_PATH when running the tests. This
*almost* works, except that there appears to be a bug in the test for
"git request-pull". That command is a Bash script that calls Perl at
some point, so it requires Perl, and therefore it cannot be supported
when NO_PERL=1. But that particular test does not check whether Git was
compiled with Perl support (other tests do include that check), and that
makes the test fail:

    t5150-request-pull.sh ..............................
    not ok 4 - pull request after push
    not ok 5 - request asks HEAD to be pulled
    not ok 6 - pull request format
    not ok 7 - request-pull ignores OPTIONS_KEEPDASHDASH poison
    not ok 9 - pull request with mismatched object
    not ok 10 - pull request with stale object
    Dubious, test returned 1 (wstat 256, 0x100)
    Failed 6/10 subtests

This output makes sense if you look at t5150-request-pull.sh. Test 1 and
2 are setup steps. Test 3 does call request-pull, but it expects the
command to fail, and it cannot distinguish between the command exiting
with a nonzero exit code, or failing to start it at all. So test 3
passes for the wrong reasons. Test 4 through 10 all call request-pull,
so they fail.

The quick workaround here is to disable the test. I will look into
upstreaming a patch that makes the test skip itself when Perl is
disabled.
2019-11-27 19:23:56 +01:00
..
bfg-repo-cleaner
bitbucket-server-cli bundlerUpdateScript: init and use (#64822) 2019-07-22 12:02:47 +00:00
cgit treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
darcs-to-git treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
delta gitAndTools.delta: 0.0.12 -> 0.0.14 2019-10-24 10:14:39 +02:00
diff-so-fancy gitAndTools.diff-so-fancy: 1.2.6 -> 1.2.7 2019-09-26 06:59:00 -07:00
fast-export gitAndTools.gitFastExport: (old) -> v190107 2019-05-12 14:40:15 +01:00
ghq ghq: Migrate to buildGoModule, ensure go 1.13 compatibility 2019-09-09 20:32:38 +02:00
git git: fix the "perlSupport = false" configuration 2019-11-27 19:23:56 +01:00
git-absorb gitAndTools.git-absorb: 0.4.0 -> 0.5.0 2019-07-17 00:00:00 -05:00
git-annex-metadata-gui treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-annex-remote-b2 treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-annex-remote-dbx git-annex-remote-dbx: init at 1.0.3 2019-04-15 17:10:17 +02:00
git-annex-remote-rclone treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-annex-utils git-annex-utils: init at 0.04-3-g531bb33 2019-10-15 14:41:24 +02:00
git-appraise treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-big-picture treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
git-bug treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-bz treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
git-codeowners treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
git-cola git-cola: build application with python3 by default 2019-09-26 20:37:03 +02:00
git-crypt treewide: don't use single quotes with placeholder 2019-09-03 13:01:42 -04:00
git-dit treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
git-extras gitAndTools.git-extras: 4.7.0 -> 5.0.0 2019-11-12 19:14:34 +01:00
git-fame treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
git-gone gitAndTools.git-gone: init at 0.1.2 2019-07-07 23:39:45 -05:00
git-hub treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-ignore treewide: update cargoSha256 hashes for cargo-vendor upgrade 2019-06-01 15:17:52 +00:00
git-imerge treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-machete git-machete: init at 2.12.1 2019-11-24 15:08:55 +02:00
git-octopus treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-open treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-radar treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-recent git-recent: 1.1.0 -> 1.1.1 2019-06-30 13:37:58 +02:00
git-remote-gcrypt treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-remote-hg gitAndTools.git-remote-hg: 1.0.0 -> 1.0.1 2019-10-07 10:47:53 -07:00
git-reparent treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-secret git-secret: 0.3.1 -> 0.3.2 2019-10-21 19:19:07 -07:00
git-secrets treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
git-standup gitAndTools.git-standup: init at 2.3.1 2019-05-31 04:20:00 -05:00
git-stree treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
git-subrepo git-subrepo: enable on Darwin 2019-11-24 16:42:34 +01:00
git-sync treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-test treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git2cl treewide: Change URLs to HTTPS 2019-04-22 10:19:54 +02:00
gita gitAndTools.gita: 0.9.2 -> 0.9.9 2019-10-12 14:47:43 +02:00
gitflow treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gitstatus treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
gitweb treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
grv treewide: name -> pname 2019-08-17 10:54:38 +00:00
hub gitAndTools.hub: 2.12.8 -> 2.13.0 2019-11-06 16:20:00 -05:00
lab gitAndTools.lab: 0.15.3 -> 0.16.0 (#62301) 2019-05-31 10:57:17 -07:00
lefthook lefthook: init at 0.6.3 (#69233) 2019-09-22 16:18:08 -05:00
pass-git-helper treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
qgit gitAndTools.qgit: 2.8 -> 2.9 2019-08-26 13:17:05 +02:00
stgit gitAndTools.stgit: 0.20 -> 0.21 2019-11-03 10:04:16 +01:00
subgit gitAndTools.subgit: 3.3.7 -> 3.3.8 2019-10-08 15:07:19 -07:00
svn-all-fast-export treewide: name -> pname 2019-08-17 10:54:38 +00:00
svn2git treewide: name -> pname 2019-08-17 10:54:38 +00:00
tig Merge branch 'master' into staging-next 2019-08-24 08:55:37 +02:00
topgit gitAndTools.topgit: 0.9 -> 0.19.12 2019-08-13 05:28:03 -07:00
transcrypt treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
default.nix git-machete: init at 2.12.1 2019-11-24 15:08:55 +02:00