git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Ruud van Asseldonk <dev@veniogames.com>
Cc: git@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH] t5150: skip request-pull test if Perl is disabled
Date: Wed, 27 Nov 2019 06:21:50 -0500	[thread overview]
Message-ID: <20191127112150.GA22221@sigill.intra.peff.net> (raw)
In-Reply-To: <4f11b5b3-a68e-642a-c5fb-7b5dae698669@veniogames.com>

On Tue, Nov 26, 2019 at 01:02:46AM +0100, Ruud van Asseldonk wrote:

> The git-request-pull.sh script invokes Perl, so it requires Perl to be
> available, but the associated test t5150 does not skip itself when Perl
> has been disabled, which then makes subtest 4 through 10 fail. Subtest 3
> still passes, but for the wrong reasons (it expects git-request-pull to
> fail, and it does fail when Perl is not available). The initial two
> subtests that do pass are only doing setup.
> 
> To prevent t5150 from failing the build when NO_PERL=1, add a check that
> sets skip_all when "! test_have_prereq PERL", just like how for example
> t3701-add-interactive skips itself when Perl has been disabled.
> 
> Signed-off-by: Ruud van Asseldonk <dev@veniogames.com>
> ---
> I discovered this issue in the Git package in Nixpkgs. The Nix package
> manager tries to make it hard to accidentally introduce undeclared
> dependencies, and it has a sandbox that hides things in /usr/bin. So
> when it builds with NO_PERL=1, it really makes no Perl available, so you
> cannot accidentally depend on the Perl in /usr/bin/perl. For the tests
> it does set PERL_PATH, but it does not point to a binary in /usr/bin.

Hmm. I don't think that technique gives complete coverage. There are
other scripts (e.g., filter-branch) that call a bare "perl" (not
PERL_PATH), which presumably pass the tests even though they'd break in
a real-world system without perl. In fact, many scripts used to do this
before fcb06a8d54 (use @@PERL@@ in built scripts, 2013-10-28). I don't
think the effects on NO_PERL were really considered there; it was more
about finding the right perl.

I think NO_PERL has historically mostly meant "do not build or install
perl scripts", and not "everything ought to run fine without perl".
We've generally assumed you can run vanilla perl snippets from the
command line the same way you'd run awk or sed (and the tests use this
extensively, which is why you have to set PERL_PATH again to run them).

That said, most of those casual uses of perl in actual built scripts
have gone away because the shell scripts have gone away. It looks like
filter-branch, request-pull, and instaweb are the last holdouts. So
maybe we should be treating NO_PERL as disabling those scripts, too.

But then, should we be doing more to make it clear that those scripts
are broken in a NO_PERL build? Who knows what happens if you run
filter-branch without any perl available?

-Peff

  parent reply	other threads:[~2019-11-27 11:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  0:02 [PATCH] t5150: skip request-pull test if Perl is disabled Ruud van Asseldonk
2019-11-26  0:43 ` Jonathan Nieder
2019-11-26  0:46 ` Jonathan Nieder
2019-11-27 22:42   ` Ruud van Asseldonk
2019-11-27 11:21 ` Jeff King [this message]
2019-11-27 23:45   ` Ruud van Asseldonk
2019-11-28  1:35     ` Jonathan Nieder
2019-11-28  1:31   ` Jonathan Nieder
2019-12-02  6:19     ` Junio C Hamano
2019-12-13  7:46       ` Jeff King
2019-12-16 18:32         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191127112150.GA22221@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=dev@veniogames.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).