public inbox for goredo-devel@lists.stargrave.org
Atom feed
From: "Sergey Matveev (stargrave=stargrave.org) via" <goredo-devel@lists.stargrave.org>
To: goredo-devel@lists.stargrave.org
Subject: Re: [PATCH] REDO_SHELL sets which shell goredo uses
Date: Wed, 14 Oct 2026 17:05:43 +0300	[thread overview]
Message-ID: <as-MN8KVjD1fyruY@stargrave.org> (raw)
In-Reply-To: <20261013160546.1791075-1-ser.goredo@ser1.net>

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

Greetings!

*** ser.goredo=ser1.net via [2026-10-13 09:02]:
>/bin/sh is not the same shell on all systems, and this can lead to non-trivial
>`do` files failing on different machines.

On POSIX systems /bin/sh is expected to be POSIX compatible.
If one writes a shell script, then it must be POSIX one. It
should behave on all POSIX-compatible systems the same way.

>On Arch, /bin/sh is a symlink to bash;
>on FuriOS (a mobile Debian distribution) it's symlinked to dash; on many
>embedded systems, it's busybox (ash). dash and bash are not compatible,
>especially in variable expansion, which can cause builds to fail across systems.

This is wrong. All those ash/bash/dash, even zsh, are compatible if
running script is POSIX one. Of course, there may be differences in
exact POSIX/SUS supported version (only relatively recently POSIX
defined setopt pipefail, which is not supported by older dash versions
(for example)).

If someone writes not the (POSIX) shell script, but bash one, then he
should explicitly set proper shebang line in it (also making it executable).
bash-script (for example) is not a shell-script, because later is expected
to be POSIX (shell) compatible.

>This patch adds a `REDO_SHELL` environment variable.

I think that this is very wrong, when people write non-POSIX compatible
scripts and call them "shell scripts", which are expected to be run
under whatever /bin/sh. But at least that REDO_SHELL could be useful for
debugging purposes, to check those shell scripts workability under
different implementations. Applied it. Thank you!

>I didn't see anywhere in the repos where the environment variables are
>documented, so there's no change that adds documentation. I think it's
>documented only on the website?

Website is just a HTML rendered doc/ subdirectory. There is doc/Env
file, which will render all backlinks to that page, which are generated
with "A [Env] REDO_...^M" lines on other pages. I mentioned REDO_SHELL
on http://www.goredo.stargrave.org/cmd/EnvCommon.html page now.

-- 
 * Origin: Stargrave's homepage http://www.stargrave.org/

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

  parent reply	other threads:[~2026-10-14 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 16:02 [PATCH] REDO_SHELL sets which shell goredo uses ser.goredo=ser1.net via
2026-10-13 16:02 ` [PATCH] REDO_SHELL sets which shell goredo uses. Some OSes change which shell /bin/sh points to; on Arch, it's bash. On Debian (on some forks, at least), it's dash. These shells are incompatible, esp about topics like variable expansion. With REDO_SHELL, users can set which shell goredo forks and ensure builds run ser.goredo=ser1.net via
2026-10-14 14:05 ` Sergey Matveev (stargrave=stargrave.org) via [this message]
2026-10-14 16:08   ` [PATCH] REDO_SHELL sets which shell goredo uses "Sean E. Russell" (ser.goredo=ser1.net) via
2026-10-16  8:43     ` Sergey Matveev (stargrave=stargrave.org) via
2026-10-16  9:37     ` Authenticating the tarballs and website Sergey Matveev (stargrave=stargrave.org) via
2026-10-16 23:20       ` "Sean E. Russell" (ser=ser1.net) via
2026-10-17  7:02         ` Sergey Matveev (stargrave=stargrave.org) via