nixpkgs/pkgs/applications
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
..
accessibility contrast: init at 0.0.2 2019-10-31 09:46:15 -04:00
audio Merge master into staging-next 2019-11-25 21:51:57 +01:00
backup deja-dup: 38.3 → 40.4 2019-11-20 04:58:00 +01:00
blockchains parity-beta: 2.6.4 -> 2.6.5 2019-11-22 23:57:49 +08:00
display-managers yelp-tools: move to top-level 2019-11-20 04:58:00 +01:00
editors Merge master into staging-next 2019-11-25 21:51:57 +01:00
gis saga: remove jasper from inputs 2019-11-17 19:17:12 +01:00
graphics Merge remote-tracking branch 'upstream/staging-next' into staging 2019-11-25 15:59:05 -05:00
kde Revert "yakuake: add missing kglobalaccel" 2019-11-24 21:24:03 +01:00
misc Merge remote-tracking branch 'upstream/staging-next' into staging 2019-11-25 15:59:05 -05:00
networking chromium: fix aarch64 build 2019-11-26 01:25:39 +01:00
office Merge staging-next into staging 2019-11-24 10:13:31 +01:00
qubes/qubes-core-vchan-xen qubes-core-vchan-xen: init at 4.1.2 2019-10-02 15:26:53 +00:00
radio Merge pull request #69979 from r-ryantm/auto-update/urh 2019-11-12 23:10:51 +01:00
science Merge staging-next into staging 2019-11-24 10:13:31 +01:00
search Merge branch 'master' into staging-next 2019-10-03 01:47:08 +02:00
version-management git: fix the "perlSupport = false" configuration 2019-11-27 19:23:56 +01:00
video Merge remote-tracking branch 'upstream/staging-next' into staging 2019-11-25 15:59:05 -05:00
virtualization Merge master into staging-next 2019-11-25 21:51:57 +01:00
window-managers cage: fix build 2019-11-23 19:04:25 +01:00