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 GDy3OhFx2WJSNwAAbAwnHQ (envelope-from ) for ; Thu, 21 Jul 2022 17:30:26 +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 KOiMOhFx2WJVZwAAauVa8A (envelope-from ) for ; Thu, 21 Jul 2022 17:30: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 919D83D29C for ; Thu, 21 Jul 2022 17:30:25 +0200 (CEST) Received: from localhost ([::1]:43364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEY88-0005Kr-O5 for larch@yhetil.org; Thu, 21 Jul 2022 11:30:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEY7p-0005KU-8E for bug-guix@gnu.org; Thu, 21 Jul 2022 11:30:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEY7n-0002ID-8p for bug-guix@gnu.org; Thu, 21 Jul 2022 11:30:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oEY7n-0008SJ-2t for bug-guix@gnu.org; Thu, 21 Jul 2022 11:30:03 -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: Thu, 21 Jul 2022 15:30: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.165841736532430 (code B ref 40641); Thu, 21 Jul 2022 15:30:02 +0000 Received: (at 40641) by debbugs.gnu.org; 21 Jul 2022 15:29:25 +0000 Received: from localhost ([127.0.0.1]:38678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEY7B-0008R0-4X for submit@debbugs.gnu.org; Thu, 21 Jul 2022 11:29:25 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:38802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEY76-0008Ql-Pt for 40641@debbugs.gnu.org; Thu, 21 Jul 2022 11:29:23 -0400 Received: by mail-qk1-f180.google.com with SMTP id e16so1539105qka.5 for <40641@debbugs.gnu.org>; Thu, 21 Jul 2022 08:29:20 -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=GNKrFD/UYKXKyHYvuGGquf1z+KK0TgNMxSlfV0/IHsw=; b=keLb5P02TxjDTej2qpbOv6CYRKf/D9oaPuYjE++n87NLVaq42mT+y+0nS8UXuUwn2T 9hTQ60imiCSOGdenuyu6bbbDcIn3gmkcmQWy3oF2i3hdI5N0Fl8wGqB6jUkPUhQT6X1Q DOBLfHD5VnGWymCjSiT4Gg4OHy3JmPN+zPNWEG8+BuhQVHur8GO3HKPqvwyvOrQqyRlr jYQtYOPMZNJcmkpiFEMyxYGNyRmu+fH3LSzeXiWn8R5SgwtoHSt9eSUkhunGxhOLUEIR kbl55LOh/NXZOmCipUINNnyFHL3lj1G+bVr5PWtu7GM/2truH3lDhpXKMfaxjjo7rVew iE/A== 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=GNKrFD/UYKXKyHYvuGGquf1z+KK0TgNMxSlfV0/IHsw=; b=8BsA9PUGSIvwkXotw6/slr+u34e5eHSg8MLuXVxoG8UqnPwHl/aNckl19u9pZ3XGCp 5anLevK+zTV+zq8JVpcadFZAU05jz6GPsq48YozO9Rt7/MgxBBIbsJPNZgf2l2el+viA qd9MD5U3K/TbrmvogH2Nt+u0N1rhf2og5FF83YGMeR//OAh+WsADJ0JjVEsviYt5r0Nw ykJ4CYJYpkj89a/fivpaJsSLQwN9FobyrrG/MAQNlM7Dq9zvguRGMCisGMRLIdSaMwV1 VH/Scp6+Gxbah95rzaUW/QiC3qcSdfKvzJbnwW8rtFSN0n09vzFoDc+zevpxmvDIPbbT LfMw== X-Gm-Message-State: AJIora+JNYWScZhBxa8rn8Sm/T5kcQmTUJud4jqgvbmLo696t3MtQiyZ Y4gOwMSiVsNdrWrZ0MGrtQUPdkiLxL0= X-Google-Smtp-Source: AGRyM1v53NZMtwdHKGcjN/GgXbd/uge2zeoA601613suun9G2tNfQJN4ahkDm7ssb1bLUExJrGweuQ== X-Received: by 2002:a05:620a:1709:b0:6b5:ea99:472 with SMTP id az9-20020a05620a170900b006b5ea990472mr14410561qkb.486.1658417354948; Thu, 21 Jul 2022 08:29:14 -0700 (PDT) Received: from hurd (dsl-157-32.b2b2c.ca. [66.158.157.32]) by smtp.gmail.com with ESMTPSA id u20-20020ac858d4000000b00304f3e320f2sm1539400qta.4.2022.07.21.08.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 08:29:14 -0700 (PDT) From: Maxim Cournoyer References: <2O2NKRGHD2OZD.30CKDJBOP4LE3@wilsonb.com> <20200415122149.j7b6bcgvrp5cpq5l@pelzflorian.localdomain> <38M8QJ1PDKHCI.2ZBQF20W9BE03@wilsonb.com> <87h74tgxui.fsf@gmail.com> <20220613144005.gv2j5igdmisnaiqv@pelzflorian.localdomain> <874k0nfcq6.fsf@gmail.com> <2N3KLAV9USDUO.2FGVQNI398LFY@"@WILSONB.COM> <20220621090254.kyskzwkliku53mob@pelzflorian.localdomain> <62c2cd89.1c69fb81.7ad72.92c8SMTPIN_ADDED_BROKEN@mx.google.com> <87edywvbdz.fsf@gmail.com> <878rp4c7em.fsf@pelzflorian.de> <87mtdhftw7.fsf@gmail.com> <62caa649.1c69fb81.5b288.1112SMTPIN_ADDED_BROKEN@mx.google.com> <87wnckeo8j.fsf@gmail.com> <87h73nep5x.fsf@gmail.com> <3NB75IRB8776E.2JKL61N4Y2UUG@wilsonb.com> Date: Thu, 21 Jul 2022 11:29:13 -0400 In-Reply-To: <3NB75IRB8776E.2JKL61N4Y2UUG@wilsonb.com> (elaexuotee@wilsonb.com's message of "Tue, 19 Jul 2022 13:14:03 +0900") Message-ID: <8735euqyba.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=1658417425; 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=GNKrFD/UYKXKyHYvuGGquf1z+KK0TgNMxSlfV0/IHsw=; b=TkD77KUbZcKgluAa9J7r0plJDk/OIyffS8yWVdgdv274eifQJhT0Whuu/C/TWYhcO5S/Z8 Bb5hFjbNXVTwTTbT2FotxFjaJyUClDwNFAzhvErYG3G2vDlSEglxss4p2gDSgq708f+tPI 6rgENu6gtNHwAuygYbMHC9VvJ+0usiRskylNrMfyoIWokY/XBk4SG3IsPc+a8D8KHLPiO1 svNuMtYH8eoar+ahcf+COzAjSVXIKCfu8IHuP5qRyqlLztv6XdB/Aqb0oJ0VCEzexR8NRt h2SB/xVJ8bWwakAXJIc9yjYLULY5duI5EcxPy7V7lV1/rAhv24pygxEkn55d1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658417425; a=rsa-sha256; cv=none; b=PYgTgE8zyCm7HA8QycM+w3f/VxeObt9hZrLseIqn1aJ2Q0P8fMHsj5gtd1PK7C8M5WLOy1 VDgEUKl4KZhzNFWT1k7PsB3m1uzrir73kGmNfcIXBbxv5qTAkeyP4xGHDw+X7kuiTQlF2x w+gfzivmvbkWCy5t9U1c2N7+kzqxa/vPt2SRCZuZWwwJ8W2rzCvmV+f+WxtQtu1D17NGBG UpTKWCw1NxAWs+z3bpvd88IXkmS/LKMRV7t3bkbTMcoIG4ReRk0Xwspf4MYo3E+Dkj8A5O x7kyKcseqQZvLqkZsBqscBxdWUg1MYJBCaHY23mUSOwxnIvH5JBOJDe2Bjvwow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=keLb5P02; 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: 5.06 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=keLb5P02; 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: 919D83D29C X-Spam-Score: 5.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: uhntvK03i4kG Hi, elaexuotee@wilsonb.com writes: > Maxim Cournoyer wrote: >> I'll see if these Bashisms can be easily switched to POSIX variants, >> else I'll experiment with setting the shebang of the test scripts to >> bash. > > Is there any particular reason to go this route? I can think of at least two: 1. GNU Autotools is designed to work across as many systems as possible, and produces POSIX-compliant shell scripts such as configure; thus keeping things in our build system (including the tests authored in shell scripts) POSIX allows to build and test Guix from source in many environments, not only in 'guix shell -D guix'. 2. Messing with Autotools-managed variables such as 'SHELL' may end up causing confusions for those relying on Autotools documented behavior. > Writing portable scripts is full of all sorts of pitfalls and ill-meaning > dragons: > > - What if SHELL=tcsh? > - What about incompatible behaviour between bash versions? > - Do we want to write tests to future-proof fixes for the above? You actually don't need to care about Bash incompatible behavior when targetting POSIX shell script. If the user goes out of their way to use a non-POSIX shell... well they are on their own. > In this case, since the build is running inside a guix shell, I don't really > see any reason to *not* effectively pin the scripts to use the bash available > in that environment. That's true for the specific use case where someone tries to build Guix inside a 'guix shell -D guix' environment, but there are also people attempting to build Guix using they system provided dependencies and shell, where the fix wouldn't help. My previous experiment showed that the Bashisms used seem limited to perhaps 2 tests; it doesn't seem too difficult to fix them using the 'shellcheck' tool to spot what syntax used is problematic and needs to be adjusted. Thanks, Maxim