I have recently pushed changes to a branch including a command to run for testing that uses Bash’s process substitution, i.e. ‘<(...)’, which in turn expects ‘/dev/fd’ to be functional.
Is it expected/intended that ‘/dev/fd’ and ‘/dev/std{in,out,err}’ are missing in Alpine Linux builds? If not, then it might be worthwhile to fix it.
On Tue, 2024-09-24 at 00:19 -0300, zamfofex@twdb.moe wrote:
> > I have recently pushed changes to a branch including a command> to run for testing that uses Bash’s process substitution, i.e.> ‘<(...)’, which in turn expects ‘/dev/fd’ to be functional.
There might be the problem. For one the feature is non-portable
(is specific to the bash shell). And the bash(1) manpage discusses
how this feature is optional and need not be universally available.
Some emulation is mentioned but still the non-portable feature
need not exist everywhere.
Even "a Linux system" does not automatically translate to "bash
in a specific configuration". Boot scripts and early/small
application code learned that lesson in the past when dash wasn't
bash. And sh never needed to be bash.
> Is it expected/intended that ‘/dev/fd’ and> ‘/dev/std{in,out,err}’ are missing in Alpine Linux builds? If> not, then it might be worthwhile to fix it.
Are you certain that the job even runs in a bash? Alpine seems to
not provide one out of the box. You'd have to install it as an
extra dependency and explicitly arrange for the shell job to
execute in the bash environment. Unless the sourcehut setup does
that for you, haven't checked. Only ran docker run -it alpine.
Can't you just rephrase your shell logic such that it doesn't
depend on one specific shell implementation? And work equally in
different setups, as you expect from a CI job? Or be explicit
about your dependencies, to at least remain aware.
virtually yours
Gerhard Sittig
--
If you don't understand or are scared by any of the above
ask your parents or an adult to help you.
On Tue, 24 Sep 2024, at 05:19, zamfofex@twdb.moe wrote:
> I have recently pushed changes to a branch including a command to run > for testing that uses Bash’s process substitution, i.e. ‘<(...)’, which > in turn expects ‘/dev/fd’ to be functional.>> Is it expected/intended that ‘/dev/fd’ and ‘/dev/std{in,out,err}’ are > missing in Alpine Linux builds? If not, then it might be worthwhile to > fix it.
/dev/stdout doesn’t exist on Alpine. On other platforms, it is created by systemd and is merely a symlink to /proc/self/fd/1.
Maybe you can use the files in /proc/ instead?
I don’t think sourcehut should create these links for you. You script fails on non-sourcehut Alpine as well.
--
Hugo
On 9/24/24 5:19 AM, zamfofex@twdb.moe wrote:
> I have recently pushed changes to a branch including a command to run for testing that uses Bash’s process substitution, i.e. ‘<(...)’, which in turn expects ‘/dev/fd’ to be functional.> > Is it expected/intended that ‘/dev/fd’ and ‘/dev/std{in,out,err}’ are missing in Alpine Linux builds? If not, then it might be worthwhile to fix it.
Just run `sudo service devfs start` before the relevant commands and it
will work.
Cheers,
Conrad