GNU bug report logs - #40641
Building from git breaks when /bin/sh isn't bash

Previous Next

Package: guix;

Reported by: elaexuotee <at> wilsonb.com

Date: Wed, 15 Apr 2020 11:07:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#40641: closed (Building from git breaks when /bin/sh isn't bash)
Date: Thu, 07 Jul 2022 21:53:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 07 Jul 2022 17:52:24 -0400
with message-id <87edywvbdz.fsf <at> gmail.com>
and subject line Re: bug#40641: Building from git breaks when /bin/sh isn't bash
has caused the debbugs.gnu.org bug report #40641,
regarding Building from git breaks when /bin/sh isn't bash
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
40641: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40641
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: elaexuotee <at> wilsonb.com
To: bug-guix <at> gnu.org
Subject: Building from git breaks when /bin/sh isn't bash
Date: Wed, 15 Apr 2020 18:06:25 +0900
[Message part 3 (text/plain, inline)]
When building from git, ./bootstrap ends up generating (via automake) several
Makefiles that set SHELL = /bin/sh. However, some targets contain rules that
make use of bashisms. This leads to breakage when /bin/sh is something other
than bash.

In particular, I am building from a foreign distro which links /bin/sh to dash.
Currently, this ends up breaking the build, the details of which I reported
to guix-devel in [0].

As a workaround, at the moment we have to force make's SHELL to point to bash.
The cleanest way to do this is probably as follows:

    $ make SHELL=$(command -v sh)

since from within guix environment --pure guix, sh ends up pointing to bash.
Just for clarity, here is how this looks for me, currently:

    $ git rev-parse HEAD
    2708ae3d69b54d8323ca84fd9a7fb108a6ee96ba
    $ guix environment --pure guix
    $ readlink -f $(command -v sh)
    /gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash

[0]:https://lists.gnu.org/archive/html/guix-devel/2020-04/msg00232.html
[signature.asc (application/pgp-signature, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: elaexuotee <at> wilsonb.com
Cc: 40641-done <at> debbugs.gnu.org,
 "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Subject: Re: bug#40641: Building from git breaks when /bin/sh isn't bash
Date: Thu, 07 Jul 2022 17:52:24 -0400
Hello,

elaexuotee <at> wilsonb.com writes:

> "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> wrote:
>> Thank you for getting back to the bug.  I am in the same situation in
>> that I use Guix System now. :D
>> 
>> On Tue, Jun 21, 2022 at 09:20:28AM +0900, elaexuotee <at> wilsonb.com wrote:
>> > so you could be able to sanity
>> > check with something like
>> > 
>> >     $ guix shell -C dash guix make <etc>
>> >     $ ln -s $(command -v dash) /bin/sh
>> >     $ ./configure --localstatedir && make
>> 
>> I had done exactly this.
>> 
>> guix shell --container --network dash git pkg-config gnutls guile
>> guile-avahi guile-gcrypt guile-json guile-lib guile-sqlite3
>> guile-zlib guile-lzlib guile-zstd guile-ssh guile-git autoconf
>> automake gettext texinfo graphviz help2man po4a findutils sed
>> coreutils tar xz m4 diffutils grep gcc-toolchain sqlite libgcrypt
>> gawk make glibc-locales -- dash
>> 
>> Many tests fail because of the container though, so I’m not sure how
>> big the effect is.  At least tests/guix-package.sh still use type -P
>> which is not POSIX, but I don’t think it should be changed nor should
>> there be a check if $SHELL can do what we need, because we don’t know
>> which bash features we need.
>
> Excellent. I agree it's probably not worth POSIXifying the scripts. Forcing
> make to default to guix's bash seems like the right approach IMHO, so +1 for
> that fix.
>
> FWIW, I ended up working around the original issue by explicitly telling make
> to use guix's bash, anyway:
>
>     $ guix environment guix bash
>     $ CONFIG_SHELL=$(command -v bash) ./configure --localstatedir=/var

OK.  Good to know, glad it can be easily worked around.

Closing.

Maxim


This bug report was last modified 3 years and 61 days ago.

Previous Next


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