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

Re: [PATCH v3 2/2] meson: prefer shell at "/bin/sh"

From
Eli Schwartz <eschwartz@gentoo.org>
Date
Apr 25, 2025, 22:25 UTC
Message-ID
<9182bbb9-fdfa-4abe-abae-4ecfd5c0f449@gentoo.org>
In-Reply-To
<aAvsT1o6wIGGCEui@tapette.crustytoothpaste.net>
On 4/25/25 4:10 PM, brian m. carlson wrote:
> All of what you said here is true, but I will point out that AT&T ksh
> (ksh93 and also ksh88) doesn't support `local`.  All of the others do,
> as do other pdksh derivatives (like OpenBSD's sh and ksh[0]).

Right, though I seem to recall e.g. all the BSDs use a pdksh variant at least.

> I believe on NonStop that `sh` is AT&T ksh, so there is no program or
> symlink named `sh` on the system which meets our needs.  The customary
> option there is to use bash instead.
Aha. :(
Show 7 quoted lines
> Additionally, Debian allows zsh as `/bin/sh`, since it meets their
> requirements, but older versions do not run all elements of a pipeline
> in a subshell, which, while allowed by POSIX as an extension,
> practically breaks our code (and lots of other code as well).  (New
> versions contain a patch I sent that fixes this behaviour when in `sh`
> mode.)  As a result, a user compiling their own Git might need to
> specify something that is not `sh` on such a system.

Nobody should be using zsh as /bin/sh at all, since it is not a POSIX shell to begin with. e.g. Gentoo does not permit it. I think Debian should treat this as a conformance bug and fix it by removing zsh support for /bin/sh until upstream zsh makes a serious effort to conform to POSIX (i.e. never)...

> And Junio points out correctly that some systems have Perl as `perl5`,
> not `perl`.  (Mostly in environments that once had or still have Perl
> 4.)

Yup. Same applies for overriding via a machine specification file as I replied regarding "sh".

> So all that to say that we do need to be able to specify an arbitrary
> path to a binary in order for things to work on some systems.
> 
> [0] Which are the same thing.
-- 
Eli Schwartz
Previous: brian m. carlsonNext: brian m. carlson
Message 27 of 31 in “meson: prefer '/bin/sh' over PATH lookup”
  1. 0/2 meson: prefer '/bin/sh' over PATH lookupPatrick Steinhardt, Apr 24, 2025
  2. 2/2 meson: prefer POSIX-specified shell pathPatrick Steinhardt, Apr 24, 2025
  3. Justin ToblerApr 24, 2025
  4. Patrick SteinhardtApr 25, 2025
  5. 1/2 meson: report detected runtime executable pathsPatrick Steinhardt, Apr 24, 2025
  6. Eli SchwartzApr 25, 2025
  7. Patrick SteinhardtApr 25, 2025
  8. Junio C HamanoApr 25, 2025
  9. Junio C HamanoApr 24, 2025
  10. Patrick SteinhardtApr 25, 2025
  11. 0/2 meson: prefer '/bin/sh' over PATH lookupPatrick Steinhardt, Apr 25, 2025
  12. 1/2 meson: report detected runtime executable pathsPatrick Steinhardt, Apr 25, 2025
  13. Toon ClaesApr 25, 2025
  14. 2/2 meson: prefer POSIX-specified shell pathPatrick Steinhardt, Apr 25, 2025
  15. Toon ClaesApr 25, 2025
  16. brian m. carlsonApr 25, 2025
  17. Patrick SteinhardtApr 25, 2025
  18. Toon ClaesApr 25, 2025
  19. 0/2 meson: prefer '/bin/sh' over PATH lookupPatrick Steinhardt, Apr 25, 2025
  20. 1/2 meson: report detected runtime executable pathsPatrick Steinhardt, Apr 25, 2025
  21. 2/2 meson: prefer shell at "/bin/sh"Patrick Steinhardt, Apr 25, 2025
  22. Junio C HamanoApr 25, 2025
  23. Eli SchwartzApr 25, 2025
  24. Junio C HamanoApr 25, 2025
  25. Eli SchwartzApr 25, 2025
  26. brian m. carlsonApr 25, 2025
  27. Eli SchwartzApr 25, 2025
  28. brian m. carlsonApr 25, 2025
  29. Junio C HamanoMay 2, 2025
  30. Eli SchwartzMay 2, 2025
  31. Patrick SteinhardtMay 5, 2025

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.