nixpkgs/pkgs/applications/version-management
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
..
arch
bazaar treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
bcompare treewide: Stop using Qt 5.9 2019-11-18 20:10:43 +00:00
bitkeeper treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
blackbox Merge master into staging-next 2019-08-27 16:36:47 +02:00
bugseverywhere treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
cvs
cvs2svn treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
cvs-fast-export
cvsps treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
diffuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
dvc dvc: init at 0.24.3 2019-10-28 13:07:58 +11:00
fossil Merge branch 'master' into rename-z77z-into-maggesi 2019-10-13 18:06:23 +02:00
gerrit gerrit: 2.14.6 -> 3.0.2 2019-09-06 22:01:22 +00:00
git-and-tools git: fix the "perlSupport = false" configuration 2019-11-27 19:23:56 +01:00
git-backup git-backup: init at 0.2.0 2019-10-24 18:50:34 -07:00
git-crecord treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
git-lfs git-lfs: use buildGoPackage 2019-09-21 04:34:00 -05:00
git-repo gitRepo: 1.13.7.1 -> 1.13.8 2019-11-19 11:08:58 +01:00
git-review treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
git-sizer git-sizer: 1.0.0 -> 1.3.0 2019-11-05 18:36:00 +01:00
git-up git-up: 1.4.2 -> 1.6.1 2019-10-03 00:19:33 +02:00
gitea gitea: 1.9.5 -> 1.10.0 2019-11-18 20:36:35 +01:00
gitinspector treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
gitkraken gitkraken: 6.3.0 -> 6.3.1 (#73048) 2019-11-08 15:29:46 +00:00
gitlab Merge pull request #73857 from petabyteboy/feature/gitlab-12-4-3 2019-11-25 20:41:26 +01:00
gitless
gitolite treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gitstats treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gogs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gource treewide: Get rid of libGLU_combined 2019-11-18 20:10:43 +00:00
guitone treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
meld maintainer: mimadrid: update github username and personal data 2019-09-14 12:15:46 +02:00
mercurial tortoisehg: untie from mercurial and update to 5.0.2 (#66173) 2019-08-18 18:28:03 +03:00
monotone treewide: Get rid of most parseDrvName without breaking compat 2019-11-24 17:22:28 +00:00
monotone-viz monotoneViz: refactor out of ocamlPackages 2019-10-30 18:05:20 +00:00
mr treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
nbstripout nbstripout: 0.3.1 -> 0.3.6 2019-09-07 14:43:43 +03:00
nitpick treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
p4v p4v: explicitly depend on openssl 1.0 series 2019-10-18 09:26:28 +11:00
peru treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
pijul pijul: fix build 2019-11-21 19:08:06 -08:00
rabbitvcs treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
rapidsvn treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
rcs
redmine redmine: 4.0.4 -> 4.0.5 2019-10-26 10:40:31 -04:00
reposurgeon
sit treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
smartgithg treewide: drop adding hicolor-icon-theme where possible 2019-09-18 22:47:26 +02:00
sourcehut sourcehut.gitsrht: build git-srht-shell 2019-11-04 01:46:59 -08:00
src src: 1.26 -> 1.27 2019-09-28 20:46:00 -07:00
srcml treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
sublime-merge
subversion subversion: 1.9.10 -> 1.9.12, 1.10.4 -> 1.10.6 2019-08-10 09:23:48 -04:00
tailor treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
tkcvs
tortoisehg treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
vcprompt treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
vcsh treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
yadm treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00