From: Simon Josefsson via Guix-patches via <guix-patches@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: "Mathieu Othacehe" <othacehe@gnu.org>,
"Ludovic Courtès" <ludo@gnu.org>,
74962@debbugs.gnu.org, "Josselin Poiret" <dev@jpoiret.xyz>,
"Janneke Nieuwenhuizen" <janneke@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 [thread overview]
Message-ID: <87ed1rjjzp.fsf@kaka.sjd.se> (raw)
In-Reply-To: <877c7ji5qm.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 29 Dec 2024 11:26:57 +0900")
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
> Hi,
>
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Simon Josefsson <simon@josefsson.org> skribis:
>>
>>> Ludovic Courtès <ludo@gnu.org> writes:
>>>
>>>> Maxim Cournoyer <maxim.cournoyer@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@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]
next prev parent reply other threads:[~2024-12-29 2:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 6:57 [bug#74962] [PATCH] etc/guix-install.sh: Explicit shebang to use /usr/bin/env Maxim Cournoyer
2024-12-19 7:17 ` [bug#74962] [PATCH 1/3] etc/teams.scm: Add etc/guix-install.sh to installer team scope Maxim Cournoyer
2024-12-19 7:17 ` [bug#74962] [PATCH 2/3] etc/guix-install.sh: Explicit shebang to use /usr/bin/env Maxim Cournoyer
2024-12-19 8:18 ` Janneke Nieuwenhuizen
2024-12-19 12:48 ` Maxim Cournoyer
2024-12-19 7:17 ` [bug#74962] [PATCH 3/3] etc/guix-install.sh: Fix quoting and other issues Maxim Cournoyer
2024-12-26 10:55 ` Ludovic Courtès
2024-12-19 7:45 ` [bug#74962] [PATCH v3 1/5] etc/teams.scm: Add etc/guix-install.sh to installer team scope Maxim Cournoyer
2024-12-19 7:45 ` [bug#74962] [PATCH v3 2/5] etc/guix-install.sh: Explicit shebang to use /usr/bin/env Maxim Cournoyer
2024-12-19 7:45 ` [bug#74962] [PATCH v3 3/5] etc/guix-install.sh: Fix quoting and other issues Maxim Cournoyer
2024-12-26 10:56 ` Ludovic Courtès
2024-12-19 7:45 ` [bug#74962] [PATCH v3 4/5] etc/guix-install.sh: Remove 'which' commands from requirements Maxim Cournoyer
2024-12-26 10:55 ` Ludovic Courtès
2024-12-26 12:34 ` Simon Josefsson via Guix-patches via
2024-12-28 16:53 ` Ludovic Courtès
2024-12-29 2:26 ` Maxim Cournoyer
2024-12-29 2:33 ` Simon Josefsson via Guix-patches via [this message]
2024-12-29 2:34 ` Maxim Cournoyer
2024-12-19 7:45 ` [bug#74962] [PATCH v3 5/5] etc/guix-install.sh: Sort requirements Maxim Cournoyer
2024-12-26 11:00 ` Ludovic Courtès
2024-12-26 10:54 ` [bug#74962] [PATCH] etc/guix-install.sh: Explicit shebang to use /usr/bin/env Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ed1rjjzp.fsf@kaka.sjd.se \
--to=guix-patches@gnu.org \
--cc=74962@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=janneke@gnu.org \
--cc=ludo@gnu.org \
--cc=maxim.cournoyer@gmail.com \
--cc=othacehe@gnu.org \
--cc=simon@josefsson.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.