Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fhFcn-0006LT-5p for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Jul 2018 14:46:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fhFcl-00062y-0b for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Jul 2018 14:46:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fhFck-00062q-MM for pgsql-hackers@lists.postgresql.org; Sun, 22 Jul 2018 14:46:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fhFcd-0007rf-Dx for pgsql-hackers@postgresql.org; Sun, 22 Jul 2018 14:46:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w6MEk32t006520; Sun, 22 Jul 2018 10:46:03 -0400 From: Tom Lane To: Noah Misch cc: Victor Wagner , pgsql-hackers Subject: Re: Non-portable shell code in pg_upgrade tap tests In-reply-to: <20180722072904.GA3951499@rfd.leadboat.com> References: <20180720153820.69e9ae6c@fafnir.local.vm> <17833.1532096747@sss.pgh.pa.us> <20180720175508.07776219@fafnir.local.vm> <20015.1532099353@sss.pgh.pa.us> <20180722072904.GA3951499@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Sun, 22 Jul 2018 07:29:04 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6518.1532270763.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 22 Jul 2018 10:46:03 -0400 Message-ID: <6519.1532270763@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Noah Misch writes: > I'd say the right way to fix this is the one specified in > https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/The= -Make-Macro-SHELL.html, > in particular: > Using @SHELL@ means that your makefile will benefit from the same impr= oved > shell, such as bash or ksh, that was discovered during configure, so t= hat > you aren't fighting two different sets of shell bugs between the two > contexts. The pg_upgrade makefile does in fact use $(SHELL), so it will default to whatever shell configure used. However, I'd expect the Autoconf guys to target a pretty darn low common denominator shell-wise. It's unlikely that the patches we just repaired were completely port-tested before commit, and we now know that the buildfarm has been falling down on the job as well. (Partly my fault, since gaur/pademelon don't run the TAP tests either. I'm hesitant to triple their already long cycle times, but ...) The bigger picture here is that it's worth maintaining a common coding style in this script. Randomly using `...` in some places and $(...) in others just increases the reader's cognitive load, as does spelling conditional blocks in multiple styles. So I'd have felt these changes were appropriate on style grounds even if there were no portability complaint. In the long run, no doubt it'd be better to rewrite test.sh in Perl, but this is what we've got today. regards, tom lane