Subject: Re: [PATCH] global: resolve Perl executable via PATH

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 5 Apr 2023 16:52:40 +0200

On Wed, Apr 05, 2023 at 10:42:52AM -0400, Todd Zullinger wrote:
> Patrick Steinhardt wrote:
> > The majority of Perl scripts we carry in Git have a `#!/usr/bin/perl`
> > shebang. This is not a portable location for the Perl interpreter and
> > may thus break on some systems that have the interpreter installed in a
> > different location. One such example is NixOS, where the only executable
> > installed in `/usr/bin` is env(1).
> 
> 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.

I'd be happy to amend the patch series to only fix up shebangs which
would not be helped by setting PERL_PATH. But if we can make it work
without having to set PERL_PATH at all I don't quite see the point.

Patrick