Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nnvwg-0000XB-7d for pgsql-committers@arkaria.postgresql.org; Mon, 09 May 2022 05:28:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nnvwe-00070G-In for pgsql-committers@arkaria.postgresql.org; Mon, 09 May 2022 05:28:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nnvwc-0006zC-VW for pgsql-committers@lists.postgresql.org; Mon, 09 May 2022 05:28:32 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nnvwY-000531-9v for pgsql-committers@lists.postgresql.org; Mon, 09 May 2022 05:28:29 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 028903200681; Mon, 9 May 2022 01:28:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 09 May 2022 01:28:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1652074103; x=1652160503; bh=ScpQG+b3T3 Y6VbBRs0vfES0LGAbPZ3+SkwKXUp/zB3U=; b=Jlmq5zGv6wswxjULeH/HADv5M3 XQAuNapkdWzVhQ1MOLbCWTdwnX7F2DfckbELeJPD+12JxuVNnysMsK76wrcL9am5 98sXNLSRkXnJW/mppsOyBuewQWoFg3YVJud/Y9NFLrMdvN77zg1h3Tw00zbbJ2H1 ssbMRIjCufLrmzFZHVam12CskWf12jHGA1UsT6TvUmLcrDdL9t5oX6MljoAI0m6i 7BwEi2d9VLGdLDm9CUw5jEwwIWXxAbZ9Yhwe3O34V/8C0d2A1FsSJrCk6rYse1EF UmWrfV1xQJwMz2uvOaQ4sESsu6pOSONPvJlZJSkRc6OLXSqSS5uoTOuXyw+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1652074103; x= 1652160503; bh=ScpQG+b3T3Y6VbBRs0vfES0LGAbPZ3+SkwKXUp/zB3U=; b=z 6VJpMqbI948WWTbUOgYoTTWBwMtTpGtZjZM2PBG1ywIULEHuU/VnEJp3tSUIFsMm 8vXIH+UecQnpKGIwMGHWO1fHsCvbtpE0W8J0Gfyk7nu33C94BcOru734rnBi/K/M IBp2xzLVLFfJnEuTxGhD7zM+iW9s7xwVntBiV6JtjYf94yzQP+5XsMNZMtPF32Wp hPsXAJ7Ll8VdBNYCh52hLE/BMFe/KJp5gPDDHdQLKwbEOaWn3pXOw/Hc/SeHhEW2 zG7bGlEH1zVM+mu/1pXNjBzlpHCtHewbkolOxow8uLtbJO2+SH4UU8ZJdTiSGIT9 BZhsi3WIduD0Zgyl4xgRQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeekgdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 May 2022 01:28:21 -0400 (EDT) Date: Mon, 9 May 2022 14:28:17 +0900 From: Michael Paquier To: Andrew Dunstan Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Remove command checks in tests of pg_basebackup and pg_receivewa Message-ID: References: <14402151-376b-a57a-6d0c-10ad12608e12@dunslane.net> <12a044c9-e982-48d9-dd29-be1216a08805@dunslane.net> <5be02606-a9de-9252-5277-269cae0ad1f0@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tj+Po0aXUlqdSl5X" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --tj+Po0aXUlqdSl5X Content-Type: multipart/mixed; boundary="AmOqOlctJ3HlpIF7" Content-Disposition: inline --AmOqOlctJ3HlpIF7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Andrew, On Sat, May 07, 2022 at 09:13:48AM +0900, Michael Paquier wrote: > Let's do that for now then as we need a middle ground for HEAD. I'll > come up with something at the beginning of next week. And here you go as of the attached to show the idea. The CI is able to execute and detect the default commands for lz4, gzip and zstd, while one of my boxes without any of those commands would ignore them. What do you think? -- Michael --AmOqOlctJ3HlpIF7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="win32-vcregress-env.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index fc7aa8b9a3..6e06686478 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -31,12 +31,11 @@ do './src/tools/msvc/config_default.pl'; do './src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); =20 # These values are defaults that can be overridden by the calling environm= ent -# (see buildenv.pl processing below). +# (see buildenv.pl processing below). We assume that the ones listed here +# always exist by default. Other values may optionally be set for binchec= k or +# taptest, see set_command_env() below. # c.f. src/Makefile.global.in and configure.ac -$ENV{GZIP_PROGRAM} ||=3D 'gzip'; -$ENV{LZ4} ||=3D 'lz4'; $ENV{TAR} ||=3D 'tar'; -$ENV{ZSTD} ||=3D 'zstd'; =20 # buildenv.pl is for specifying the build environment settings # it should contain lines like: @@ -119,6 +118,41 @@ exit 0; =20 ######################################################################## =20 +# Helper function for set_command_env, to set one environment command. +sub set_single_env +{ + my $envname =3D shift; + my $envdefault =3D shift; + + # If a command is defined by the environment, just use it. + return if (defined($ENV{$envname})); + + # Nothing is defined, so attempt to assign a default. The command + # may not be in the current environment, hence check if it can be + # executed. + my $rc =3D system($envdefault, '--version'); + if ($rc !=3D 0) + { + # Execution of the default command failed, so reset its + # environment value. + $ENV{$envname} =3D ''; + return; + } + + # Set the environment to the default as it exists. + $ENV{$envname} =3D $envdefault; + return; +} + +# Set environment values for various command types. These can be used +# in the TAP tests. +sub set_command_env +{ + set_single_env('GZIP_PROGRAM', 'gzip'); + set_single_env('LZ4', 'lz4'); + set_single_env('ZSTD', 'zstd'); +} + sub installcheck_internal { my ($schedule, @EXTRA_REGRESS_OPTS) =3D @_; @@ -276,6 +310,8 @@ sub bincheck { InstallTemp(); =20 + set_command_env(); + my $mstat =3D 0; =20 # Find out all the existing TAP tests by looking for t/ directories @@ -310,6 +346,9 @@ sub taptest push(@args, "$topdir/$dir"); =20 InstallTemp(); + + set_command_env(); + my $status =3D tap_check(@args); exit $status if $status; return; --AmOqOlctJ3HlpIF7-- --tj+Po0aXUlqdSl5X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmJ4pnEACgkQnvQgOdby QH2z3hAApfcb1tuZ6FzTJ32XUMCz5AuGieESZyDceH045TixCDhOoaEXS/LpRo76 ivZMZuFOprbjSF7+d/saPUSfvkR8VMNMYwI+Adhhwa3uslV2OnzktC6EdvGU+pJo SCscyG4GeYDz0/qqwGE4x+Qejvo+8oeWlJ9WYDQs2ad0loNliUiEmwXGOvaWaQ9d hqGL70RPwYToz05W38UshDb2/dfl4RJBaakmoMzyXcxN+5AkKmPdsOUoABqUEcSV jtXYIqjhUNSrj4Ar9dEWv6h9IECN7eZb82XINwyx3ZfGC+IeHMVIhVYi6N2Zunrx iodaPHIVoFqGnPdr89Q9h2XX/wcwaa9EKsffhpOjjCF5dMuzmluIVFpbc9OSiLda Maw+YP48Xsv+SnbW+8MWGHz6r+MfiHLpnBJkSXiHjSkqBaiJYxWIs/HlNo8uZ+hC 0eT4vg7YkbyLkZBbWGoY/xHcz+L7QbrUIICyq+aBKKSZfqc7CJwVeDWLtinIzBpP e96d6n8zq8WmLp3mIX0hiOMcgDzipLuSpC1LnfpmbFYwtpb7hRuQSC9BRUyph4hV sH6yR4tbFN6DYIEQZHNHnHu+I1cG8ZdJAPeEOlZRuoCuN1ma1oKJ7s/seCNJlpZb GkW1cI0irmrqgW/VyQvCHGd0gGAWlrR2Eq2IWe/a//jhbn0eWMQ= =8y+U -----END PGP SIGNATURE----- --tj+Po0aXUlqdSl5X--