Subject: bug#51466: bug#53355: guix shell --check: confusing error message

From: Chris Marusich <[email-masked]>
Date: Sat, 25 Jun 2022 09:52:26 -0700

Hi Maxime,

Maxime Devos <[email-masked]> writes:

> Chris Marusich schreef op za 25-06-2022 om 02:07 [-0700]:
>> 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
>
> I consider temporary files to be more fragile -- you have to take care
> of file permissions, removing the file afterwards even after an
> interrupt with C-c, deleting the temporary file can fail, there might
> be an out-of-space error, in case of file system corruption things
> might be remounted read-only, some other program could read, write or
> delete the file ..., so I think it would be best to just fix the bug in
> dash instead.

Yes, I agree those are good reasons to avoid a temporary file if we can.
To that end, do you know if we can somehow force Guile to use a specific
file descriptor for the pipe?  In the patch I wrote earlier, which uses
redirection, the problem was that I could not control Guile's choice of
file descriptors.  Guile chose file descriptor 19 for one end of the
pipe, and I don't know how to make it use anything else.  If we can
arrange for Guile to consistently use file descriptor 7, for example,
then probably it would work in all the shell I've tested.

I wonder if maybe I can just duplicate the file descriptor?  I don't
know; if for example Guile reserves all the file descriptors below 10
for other uses, it might be hard.

What do you think?  Is there a way to do it?

-- 
Chris

PGP: https://savannah.gnu.org/people/viewgpg.php?user_id=106836