Re: [PATCH] global: resolve Perl executable via PATH
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 5, 2023, 14:52 UTC
- Message-ID
- <ZC2LOAwycdaUawxM@ncase>
- In-Reply-To
- <ZC2I7CfVzY6Tl7Pk@pobox.com>
On Wed, Apr 05, 2023 at 10:42:52AM -0400, Todd Zullinger wrote:
Show 11 quoted lines
> 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