From mboxrd@z Thu Jan 1 00:00:00 1970 From: elaexuotee--- via Bug reports for GNU Guix Subject: bug#40641: Building from git breaks when /bin/sh isn't bash Date: Fri, 17 Apr 2020 23:57:04 +0900 Message-ID: <38M8QJ1PDKHCI.2ZBQF20W9BE03@wilsonb.com> References: <2O2NKRGHD2OZD.30CKDJBOP4LE3@wilsonb.com> <20200415122149.j7b6bcgvrp5cpq5l@pelzflorian.localdomain> Reply-To: elaexuotee@wilsonb.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="----_=_064465a37bd4286b3a903232_=_" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59179) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPTc0-0008MR-6F for bug-guix@gnu.org; Fri, 17 Apr 2020 12:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPTby-0007A2-UG for bug-guix@gnu.org; Fri, 17 Apr 2020 12:13:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58265) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPTby-00079r-Mw for bug-guix@gnu.org; Fri, 17 Apr 2020 12:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPTby-00023x-GQ for bug-guix@gnu.org; Fri, 17 Apr 2020 12:13:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20200415122149.j7b6bcgvrp5cpq5l@pelzflorian.localdomain> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: "pelzflorian (Florian Pelz)" Cc: 40641@debbugs.gnu.org This is a multipart message in MIME format. ------_=_064465a37bd4286b3a903232_=_ MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_40e4eb697d18a189045b3508_=_" This is a multipart message in MIME format. ------_=_40e4eb697d18a189045b3508_=_ Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable "pelzflorian (Florian Pelz)" wrote: > On Wed, Apr 15, 2020 at 06:06:25PM +0900, elaexuotee--- via Bug reports f= or GNU Guix wrote: > > When building from git, ./bootstrap ends up generating (via automake) s= everal > > Makefiles that set SHELL =3D /bin/sh. However, some targets contain rul= es that > > make use of bashisms. This leads to breakage when /bin/sh is something = other > > than bash. > >=20 > > 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 repo= rted > > to guix-devel in [0]. >=20 > is related. Your workaround may be more wel= come. >=20 > Regards, > Florian Florian, Thanks for the pointer. I ended up doing a little bit of sleuthing and thin= k I figured out a relatively clean fix---a simple one-liner in configure.ac. Attached is a proof-of-concept patch against master (974bf81776). Currently, autoconf sets make's shell to whatever it thinks is best. On a foreign distribution, this often ends up something external to guix profile= =2E However, when this isn't bash, we run into problems. The patch's idea is to let make use its hard-coded default shell. A guix-bu= ilt make will correctly fallback to whichever sh is in the profile, so for `gui= x environment guix' this effectively becomes $GUIX_ENVIRONMENT/bin/sh. For example, $ echo '$(info $(SHELL))' | make -f - /gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/sh make: *** No targets. Stop. I belive this should do the Right Thing. However, is there anything I am missing? Perhaps this change would break build scenaries I am not thinking = of? Cheers, B. Wilson ------_=_40e4eb697d18a189045b3508_=_ Content-Disposition: attachment; filename*0*=UTF-8''0001-build-Let-make-use-its-hard-coded-default-shell.; filename*1*=patch Content-Type: text/plain Content-Transfer-Encoding: 7bit >From 6a5533fde0580a777a10f1155714f23a003003d9 Mon Sep 17 00:00:00 2001 From: "B. Wilson" Date: Thu, 16 Apr 2020 17:02:06 +0900 Subject: [PATCH] build: Let make use its hard-coded default shell To: guix-patches@gnu.org * configure.ac: Set AM_SUBST_NOTMAKE([SHELL]) --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 6a6a020585..dbb06f2258 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.14 gnu silent-rules subdir-objects \ color-tests parallel-tests -Woverride -Wno-portability]) +# Use make's hard-coded default shell. The make in a guix profile +# defaults to the Right Thing, e.g. $GUIX_ENVIRONMENT/bin/sh +AM_SUBST_NOTMAKE([SHELL]) + # Enable silent rules by default. AM_SILENT_RULES([yes]) -- 2.26.1 ------_=_40e4eb697d18a189045b3508_=_-- ------_=_064465a37bd4286b3a903232_=_ Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYIADUWIQQ7FdZn/PDWvxE6cmR2pStZ7i7CgQUCXpnSlRccZWxhZXh1b3Rl ZUB3aWxzb25iLmNvbQAKCRB2pStZ7i7CgbieAQD6NNh9jtg6Cimpgrv78M9hgwTU XMTiaXaT2xddzJPnJAEAhUWbcFLeLWphvbYNHVzPBJ296wzWQYh2x2ACy1NVLAk= =mxC5 -----END PGP SIGNATURE----- ------_=_064465a37bd4286b3a903232_=_--