GNU bug report logs - #74962
[PATCH] etc/guix-install.sh: Explicit shebang to use /usr/bin/env.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 19 Dec 2024 06:59:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Simon Josefsson <simon <at> josefsson.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Mathieu Othacehe <othacehe <at> gnu.org>, Ludovic Courtès <ludo <at> gnu.org>, 74962 <at> debbugs.gnu.org, Josselin Poiret <dev <at> jpoiret.xyz>, Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: [bug#74962] [PATCH v3 4/5] etc/guix-install.sh: Remove 'which' commands from requirements.
Date: Sun, 29 Dec 2024 03:33:46 +0100
[Message part 1 (text/plain, inline)]
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> Hi,
>
> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Simon Josefsson <simon <at> josefsson.org> skribis:
>>
>>> Ludovic Courtès <ludo <at> gnu.org> writes:
>>>
>>>> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
>>>>
>>>>> * etc/guix-install.sh (REQUIRE): Remove "which".  Add "nologin".
>>>>> (sys_create_build_user): Use 'type' instead of 'which'.
>>>>>
>>>>> Fixes: <https://issues.guix.gnu.org/74952>
>>>>> Reported-by: Simon Josefsson <simon <at> josefsson.org>
>>>>> Change-Id: I0675716bab3fc22d3289ee7af2cb0ab33a1cee71
>>>>
>>>> LGTM.
>>>
>>> Using 'type -P' is not POSIX and neither /bin/dash nor /bin/gash
>>> supports it.  It seems like a GNU bash extension.  Is that okay?
>>
>> Oh, not great.  From what you write, I’m not sure what to conclude;
>> just skip this patch and be done with it?
>
> We currently use other Bash-specific features, so I think it's fine to
> embrace the Bash requirement instead of shying away from it.
>
> If we decide that we don't want Bash as a requirement at some point,
> we'll have to change a bunch of things; one of them would be to no
> longer make use of arrays since POSIX shells don't have them, for
> example.

There is a difference to use bashisms in code in Guix intended to be run
on bash, and code we have in the manual that is suggested to be used on
other operating system as part of the Guix installation process.

There appears to be no perfect solution here.  I think 'command -v
nologin' is the closest.  Or just keep the code as-is and use 'which',
but that caused my initial problem (lack of 'which').

I'd like to second-guess why we even bother with using "nologin" instead
of simply hard-coding "/bin/false" or why not "/" which I suppose is not
a executable shell on any system.

/Simon
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.