From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gPHNBs2RomJRkQAAbAwnHQ (envelope-from ) for ; Fri, 10 Jun 2022 02:35:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mFFqBs2RomJJugAAauVa8A (envelope-from ) for ; Fri, 10 Jun 2022 02:35:25 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B298FDCDA for ; Fri, 10 Jun 2022 02:35:23 +0200 (CEST) Received: from localhost ([::1]:50396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzScU-0002kn-5a for larch@yhetil.org; Thu, 09 Jun 2022 20:35:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzScA-0002kP-OG for bug-guix@gnu.org; Thu, 09 Jun 2022 20:35:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54351) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzScA-0002cS-DT for bug-guix@gnu.org; Thu, 09 Jun 2022 20:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzScA-0003EU-7H for bug-guix@gnu.org; Thu, 09 Jun 2022 20:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40641: Building from git breaks when /bin/sh isn't bash Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 10 Jun 2022 00:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40641 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: elaexuotee@wilsonb.com Cc: 40641@debbugs.gnu.org, "pelzflorian \(Florian Pelz\)" Received: via spool by 40641-submit@debbugs.gnu.org id=B40641.165482130012413 (code B ref 40641); Fri, 10 Jun 2022 00:35:02 +0000 Received: (at 40641) by debbugs.gnu.org; 10 Jun 2022 00:35:00 +0000 Received: from localhost ([127.0.0.1]:48248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzSc7-0003E8-Iz for submit@debbugs.gnu.org; Thu, 09 Jun 2022 20:34:59 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:46653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzSc2-0003Dq-JP for 40641@debbugs.gnu.org; Thu, 09 Jun 2022 20:34:58 -0400 Received: by mail-qk1-f180.google.com with SMTP id o68so18907667qkf.13 for <40641@debbugs.gnu.org>; Thu, 09 Jun 2022 17:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bOFzRRpiU9ZsZFoZ36jlL+ITtYEjeLyOHha39IPjqR4=; b=RpAkPUc6nPNSxVMyc8qWQ+yKCJ+6oEDyl6ou93cAl8E2AVB83TbdetDoKm5yBW2UYk xCO+KT9yAH6TiTC//UENTSACoNm3SFVbIeUnS0GhndKFrM+DzKGqb8egG4Rc+3Uh5DOp bh8O8A8FFvV8HZ3c2oH1SY49rtVBEYzzvVnaLvSu2T0ou3StGL6CcAPf0sIeuqXCg1Dy 7vMt8uuUwGBWCDVPRnWGh6u3KD/K8nIfl8jT8EhmtNdl2L04zDbGAxzSvNw6tC0ZwSeT NhkzCzG8RABq+dI+LLTDe0QpfOQyYqqGkoR4U77T8Zl+dfAepMJr8jItdaYaWqhegqyI 8D7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bOFzRRpiU9ZsZFoZ36jlL+ITtYEjeLyOHha39IPjqR4=; b=M2OlPK/1ABTHLOPc5FgM8EwDKI7L2AYfAQjtuKpxCp/l3OB+6EfjiXS+g051ng+sA+ AmR0dbD+2MBiryXipthCO86r1rfUkk6Rn9UiMAV/jWICFYd9PPwy5wSDPqfjA+G8Och1 lQF0I55uDFPCE87KhyPVrLzMWWlHQ1ttylbFRhH2bu+t3Sg5HNXY17XDZzjTr8cexVbH JmF8MygIsdkg8dUVY76ScNiUeabijv8TnCNroKe3b8I+zAXaT3A6qiZi49wIEL2tuFoZ JX0X9mlX7NCFwfsYFFURqgIaTWlLe+RvScmsI8LLAN12MFDgHQ0uvl39EXEczYpY7XXy xQSA== X-Gm-Message-State: AOAM531rqn4jEO3WelwSQa8mIQsj12FVoJqJmAepHujVkW4gFPK84IBK ST0AAXE9hpMjp3lKxgEtLiqelIlRGsg7jA+d X-Google-Smtp-Source: ABdhPJwCUHPkTDOiz1rW3zQyr7inYfn7MsYilCL6kUcOTOLuws1RQjwpv+LIlBQdSbh0FwoxmYd8Ag== X-Received: by 2002:a37:5404:0:b0:6a6:48c7:b137 with SMTP id i4-20020a375404000000b006a648c7b137mr28682515qkb.284.1654821288290; Thu, 09 Jun 2022 17:34:48 -0700 (PDT) Received: from hurd (dsl-155-254.b2b2c.ca. [66.158.155.254]) by smtp.gmail.com with ESMTPSA id f11-20020a05620a280b00b006a6bd7028d5sm11924843qkp.18.2022.06.09.17.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 17:34:47 -0700 (PDT) From: Maxim Cournoyer References: <2O2NKRGHD2OZD.30CKDJBOP4LE3@wilsonb.com> <20200415122149.j7b6bcgvrp5cpq5l@pelzflorian.localdomain> <38M8QJ1PDKHCI.2ZBQF20W9BE03@wilsonb.com> Date: Thu, 09 Jun 2022 20:34:45 -0400 In-Reply-To: <38M8QJ1PDKHCI.2ZBQF20W9BE03@wilsonb.com> (elaexuotee@wilsonb.com's message of "Fri, 17 Apr 2020 23:57:04 +0900") Message-ID: <87h74tgxui.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654821323; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=bOFzRRpiU9ZsZFoZ36jlL+ITtYEjeLyOHha39IPjqR4=; b=Z0VbySB4GZS2zO7BPfYMZCXqM3ZVPngri/6lPC2pMbxfQCV5aHL9g+Ebrq5ZInTM7ebldV XvonCcqzcFLFD/WEP1QpxsxxJBMETAhBb1G/ErYTZsCzPUl1AZv/xXi6AjvNeRbt+yNrjm 1aHKfNbDbpHsDyobcPJ0M8To1fYwZY6NwbNkwlbvDz2AQZa4aX6YWwaUGml3xn3FtWB7IW nOIuqO1kcLU6rmPsEa8xrN9m2XjoIifgy+ofKBrMM6dDQ9/kL/TTfNEzNitZSdueMWKwB6 OwtHHq7cT5Rj+RJfY8HKBLU4DQyyYIHiyqsoZD4nUmlGsXY9tQS7fisF7TWdHQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654821323; a=rsa-sha256; cv=none; b=EMEP8Uu7wNpuFQMQ9TWe+sLRbBsxS7ktVVgXQeUKw9wl1Xs3LvZD81hCoRToIcYuGk4Onv 9iaO4rCcfKoz3ra1edSLdnBANANxhCkT/5+IZuDrZJFkSrc/BebVP41tVAuiIQ7Ey6IsR5 HFaEj8xV0yRY6lQ4znRRKc0aPa/8gSs74Pwp4ndUXijdCanZ8yQ19S+35aGbl8yMO5RsCA bHM14Q0LBLTv+rEarF/SWmhR/QQnU2qYRmrauJMd6vBXLMUtnf8L17y9CIUbRImKHiKuEY 0LHM0o8uv77OK5Dd6IXxS1z2MQUB8B0eAY8bHFFOC9W9j1C9FilO/JlViJ234g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=RpAkPUc6; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=RpAkPUc6; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B298FDCDA X-Spam-Score: 6.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: HLnM+Ysuyjio Hello, elaexuotee@wilsonb.com writes: > "pelzflorian (Florian Pelz)" wrote: >> On Wed, Apr 15, 2020 at 06:06:25PM +0900, elaexuotee--- via Bug reports for GNU Guix wrote: >> > 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]. >> >> is related. Your workaround may be more welcome. >> >> Regards, >> Florian > > > Florian, > > Thanks for the pointer. I ended up doing a little bit of sleuthing and think > 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. > 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-built > make will correctly fallback to whichever sh is in the profile, so for `guix > 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? This seems odd to me. Perhaps it'd be cleaner to detect which shell is used at configure time to detect when /bin/sh != Bash, and warn that if there are issues, the user should set the SHELL variable to Bash. Or if the Bashisms are scarce enough, perhaps we can rewrite the routines in POSIXly correct shell, although this being a GNU project I don't really see the merit of forcing lesser shells (and less readable code) on ourselves. Could you provide a list of the problematic targets? Or if my suggestion sounds good, give it a shot? Thanks :-) Maxim