git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 5, 2023, 14:48 UTC
Message-ID
<ZC2KICsJN5pmsqWX@ncase>
In-Reply-To
<CAMP44s0eLNOWFr7fc6M5Fompw1Y13vAxk8=fAWVZ8-22Y-xihg@mail.gmail.com>
On Wed, Apr 05, 2023 at 08:35:50AM -0500, Felipe Contreras wrote:
Show 19 quoted lines
> On Wed, Apr 5, 2023 at 5:53 AM Patrick Steinhardt <ps@pks.im> 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).
> >
> > Convert the shebangs to resolve the location of the Perl interpreter via
> > env(1) to make these scripts more portable. While the location of env(1)
> > is not guaranteed by any standard either, in practice all distributions
> > including NixOS have it available at `/usr/bin/env`. We're also already
> > using this idiom in a small set of other scripts, and until now nobody
> > complained about them.
> 
> This is standard practice in Ruby, and it does seem to work everywhere.
> 
> However, I wonder if /bin/env does also work. I can't imagine a system
> system providing /usr/bin/env but not /bin/env.

NixOS does indeed only have /usr/bin/env and does not have /bin/env, so it wouldn't.

Patrick
Previous: Felipe ContrerasNext: Todd Zullinger
Message 3 of 27 in “global: resolve Perl executable via PATH”
  1. global: resolve Perl executable via PATHPatrick Steinhardt, Apr 5, 2023
  2. Felipe ContrerasApr 5, 2023
  3. Patrick SteinhardtApr 5, 2023
  4. Todd ZullingerApr 5, 2023
  5. Patrick SteinhardtApr 5, 2023
  6. Todd ZullingerApr 5, 2023
  7. Felipe ContrerasApr 5, 2023
  8. Patrick SteinhardtApr 5, 2023
  9. Junio C HamanoApr 5, 2023
  10. Felipe ContrerasApr 6, 2023
  11. Jeff KingApr 5, 2023
  12. Patrick SteinhardtApr 5, 2023
  13. Jeff KingApr 5, 2023
  14. Felipe ContrerasApr 6, 2023
  15. Jeff KingApr 6, 2023
  16. Ævar Arnfjörð BjarmasonApr 6, 2023
  17. Felipe ContrerasApr 18, 2023
  18. Patrick SteinhardtApr 6, 2023
  19. Kristoffer HaugsbakkApr 5, 2023
  20. Eric WongApr 5, 2023
  21. Felipe ContrerasApr 6, 2023
  22. Ævar Arnfjörð BjarmasonApr 6, 2023
  23. Jeff KingApr 6, 2023
  24. Patrick SteinhardtApr 6, 2023
  25. t/lib-httpd: pass PERL_PATH to CGI scriptsJeff King, Apr 6, 2023
  26. Junio C HamanoApr 6, 2023
  27. Felipe ContrerasApr 18, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.