[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#51466: bug#53355: guix shell --check: confusing error message
From: |
Chris Marusich |
Subject: |
bug#51466: bug#53355: guix shell --check: confusing error message |
Date: |
Sat, 25 Jun 2022 02:07:50 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi Ludo & Everyone,
Chris Marusich <cmmarusich@gmail.com> writes:
> Is it OK to rely on shell redirection?
It turns out that it is probably not OK to rely on shell redirection in
this case, after all. For example, "dash does not support multi-digit
file descriptors":
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/249620
Indeed, the patch I proposed earlier to rely on shell redirection caused
a command like
./pre-inst-env env
SHELL=/gnu/store/nm0hccsphymxi8c24xmg6ixm9vcf25xb-dash-0.5.11.5/bin/dash guix
shell --check --container -D guix
to hang. It hangs because the FD Guile chooses to create and embed in
the script is 19 (on my machine, at least). A redirection like
"env >&19" causes dash to error out, so no environment information gets
sent back to the parent process. The same issue seemed to occur for the
ksh from our oksh package.
To resolve this, I changed the code so that it just writes to a
temporary file. This is simple and more robust. With the attached
patch, I was able to use a command like the one above to verify that
"guix environment --check" works correctly for Guix-built bash, dash,
ksh, fish, zsh, and ash. I also verified that it works for Fedora's
/bin/sh and /bin/bash.
What do you think of this file-based approach? Supporting many
different shells is pretty tricky, but I think this patch does a good
enough job.
--
Chris
PGP: https://savannah.gnu.org/people/viewgpg.php?user_id=106836
0001-environment-Prevent-PS1-from-clobbering-output-in-ch.patch
Description: Text Data
signature.asc
Description: PGP signature
- bug#51466: bug#53355: guix shell --check: confusing error message,
Chris Marusich <=
bug#53355: guix shell --check: confusing error message, Ludovic Courtès, 2022/06/27