git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: Todd Zullinger <tmz@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] global: resolve Perl executable via PATH
Date: Wed, 5 Apr 2023 19:32:22 +0200	[thread overview]
Message-ID: <ZC2wppC62E7wOcqM@xps> (raw)
In-Reply-To: <20230405165414.GA497301@coredump.intra.peff.net>

[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]

On Wed, Apr 05, 2023 at 12:54:14PM -0400, Jeff King wrote:
> On Wed, Apr 05, 2023 at 04:52:40PM +0200, Patrick Steinhardt wrote:
> 
> > > Is there a reason to not set PERL_PATH, which is the
> > > documented method to handle this?  From the Makefike:
> > > 
> > > # Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl).
> > 
> > Setting PERL_PATH helps with a subset of invocations where the Makefile
> > either executes Perl directly or where it writes the shebang itself. But
> > the majority of scripts I'm touching have `#!/usr/bin/perl` as shebang,
> > and that path is not adjusted by setting PERL_PATH.
> 
> Which scripts? If I do:
> 
>   mkdir /tmp/foo
>   ln -s /usr/bin/perl /tmp/foo/my-perl
>   make PERL_PATH=/tmp/foo/my-perl prefix=/tmp/foo install
> 
>   head -n 1 /tmp/foo/bin/git-cvsserver
> 
> Then I see:
> 
>   #!/tmp/foo/my-perl
> 
> And that is due to this segment in the Makefile:
> 
>   $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
>           $(QUIET_GEN) \
>           sed -e '1{' \
>               -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \
>               -e '        r GIT-PERL-HEADER' \
>               -e '        G' \
>               -e '}' \
>               -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
>               $< >$@+ && \
>           chmod +x $@+ && \
>           mv $@+ $@
> 
> And that behavior goes all the way back to bc6146d2abc ('build' scripts
> before installing., 2005-09-08). If there are some perl scripts we are
> "building" outside of this rule, then that is probably a bug.
> 
> The only thing I found via:
> 
>   find /tmp/foo -type | xargs grep /usr/bin/perl
> 
> was a sample hook (which is probably a bug; we do munge the hook scripts
> to replace @PERL_PATH@, etc, but I think the Makefile never learned that
> the template hook scripts might be something other than shell scripts).

Yeah, agreed, the scripts we install are fine from all I can tell. I
should've clarified, but what I care about is our build infra as well as
our test scripts. That's neither clear from the commit description nor
from the changes that I'm doing.

I'd be happy to keep the current state of installed scripts as-is and
resend another iteration of this patch that only addresses shebangs used
in internal scripts.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-04-05 17:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 10:10 [PATCH] global: resolve Perl executable via PATH Patrick Steinhardt
2023-04-05 13:35 ` Felipe Contreras
2023-04-05 14:48   ` Patrick Steinhardt
2023-04-05 14:42 ` Todd Zullinger
2023-04-05 14:52   ` Patrick Steinhardt
2023-04-05 15:54     ` Todd Zullinger
2023-04-05 17:09       ` Felipe Contreras
2023-04-05 17:35       ` Patrick Steinhardt
2023-04-05 18:44         ` Junio C Hamano
2023-04-06  2:27           ` Felipe Contreras
2023-04-05 16:54     ` Jeff King
2023-04-05 17:32       ` Patrick Steinhardt [this message]
2023-04-05 18:15         ` Jeff King
2023-04-06  2:18           ` Felipe Contreras
2023-04-06  3:35             ` Jeff King
2023-04-06  8:03               ` Ævar Arnfjörð Bjarmason
2023-04-18  8:59                 ` Felipe Contreras
2023-04-06  8:07           ` Patrick Steinhardt
2023-04-05 18:28 ` Kristoffer Haugsbakk
2023-04-05 21:30 ` Eric Wong
2023-04-06  2:16   ` Felipe Contreras
2023-04-06  8:05   ` Ævar Arnfjörð Bjarmason
2023-04-06  3:26 ` Jeff King
2023-04-06  8:19   ` Patrick Steinhardt
2023-04-06  9:36     ` [PATCH] t/lib-httpd: pass PERL_PATH to CGI scripts Jeff King
2023-04-06 16:34       ` Junio C Hamano
2023-04-18  9:04       ` Felipe Contreras

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=ZC2wppC62E7wOcqM@xps \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=tmz@pobox.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).