From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Check that we have a working tar before trying to use it
Date: Tue, 14 Dec 2021 14:17:25 +0900
Message-ID: <Ybgo5ZWgqeUeW79F@paquier.xyz> (raw)
In-Reply-To: <190aad26-d04b-f2c6-c4a3-e184377f4c8c@dunslane.net>
References: <20211209021604.bv5tfr23ymh4u7x4@alap3.anarazel.de>
<3707204.1639016334@sss.pgh.pa.us>
<20211209024604.dpmudj4ax2hoi7cx@alap3.anarazel.de>
<20211209030856.ibxewzpc5ph7ckkp@alap3.anarazel.de>
<YbGYe483803il3X7@paquier.xyz>
<20211209064928.7f5lp6hxvw2f2j6o@alap3.anarazel.de>
<YbGr7ylYwE56l91B@paquier.xyz>
<95787b2b-d483-0b5e-b24b-1986cff93596@dunslane.net>
<Ybb/itFhY3FrsyzF@paquier.xyz>
<190aad26-d04b-f2c6-c4a3-e184377f4c8c@dunslane.net>
On Mon, Dec 13, 2021 at 11:47:36AM -0500, Andrew Dunstan wrote:
> No. The code only sets them if they have not been previously set by
> buildenv.pl or the calling environment. That's what "||=" means.
Well, using ||= after the fact means that it is not possible to delete
any of those environment variables either in buildenv.pl, nor is it
possible to set them to empty string values, as vcregress.pl would
just reset them to the default value. And that's the case I am
arguing for here. We don't have any need to drop those default values
at all. What I am arguing for here is the possibility to have
something more flexible than what HEAD proposes.
So, if we do something like say the attached, then it is possible to
handle environments like mine, while keeping the flexibility you are
looking for to set those defaults. So that would be the best of both
worlds, no?. I also think that we had better document all that
properly, as we do for any other TAP-related variable that can be used
in vcregress.pl. All that leads me to the attached.
--
Michael
Attachments:
[text/x-diff] win32-perl.patch (2.7K, ../Ybgo5ZWgqeUeW79F@paquier.xyz/2-win32-perl.patch)
download | inline diff:diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgmlindex b33359d3af..30dd0c7f75 100644--- a/doc/src/sgml/install-windows.sgml+++ b/doc/src/sgml/install-windows.sgml@@ -517,6 +517,40 @@ $ENV{PROVE_FLAGS}='--timer --jobs 2'
$ENV{PROVE_TESTS}='t/020*.pl t/010*.pl'
</programlisting>
</para>
++ <para>+ Some of the TAP tests depend on a set of external commands that would+ optionally trigger tests related to them. Each one of those variables+ can be set or unset in <filename>buildenv.pl</filename>:+ <variablelist>+ <varlistentry>+ <term><varname>GZIP_PROGRAM</varname></term>+ <listitem><para>+ Path to a <application>gzip</application> command. The default is+ <literal>gzip</literal>, that would be the command found in+ <varname>PATH</varname>.+ </para></listitem>+ </varlistentry>++ <varlistentry>+ <term><varname>LZ4</varname></term>+ <listitem><para>+ Path to a <application>lz4</application> command. The default is+ <literal>lz4</literal>, that would be the command found in+ <varname>PATH</varname>.+ </para></listitem>+ </varlistentry>++ <varlistentry>+ <term><varname>TAR</varname></term>+ <listitem><para>+ Path to a <application>tar</application> command. The default is+ <literal>tar</literal>, that would be the command found in+ <varname>PATH</varname>.+ </para></listitem>+ </varlistentry>+ </variablelist>+ </para>
</sect2>
</sect1>
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.plindex 5975e7c9cd..8775da4edf 100644--- a/src/tools/msvc/vcregress.pl+++ b/src/tools/msvc/vcregress.pl@@ -30,6 +30,13 @@ my $tmp_installdir = "$topdir/tmp_install";
do './src/tools/msvc/config_default.pl';
do './src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl');
+# These values are defaults that can be overridden by the calling environment+# (see buildenv.pl processing below).+# c.f. src/Makefile.global.in and configure.ac+$ENV{TAR} ||= 'tar';+$ENV{LZ4} ||= 'lz4';+$ENV{GZIP_PROGRAM} ||= 'gzip';+
# buildenv.pl is for specifying the build environment settings
# it should contain lines like:
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
@@ -67,13 +74,6 @@ $ENV{with_gssapi} = $config->{gss} ? 'yes' : 'no';
$ENV{with_krb_srvnam} = $config->{krb_srvnam} || 'postgres';
$ENV{with_readline} = 'no';
-# These values are defaults that can be overridden by the calling environment-# (see buildenv.pl processing above).-# c.f. src/Makefile.global.in and configure.ac-$ENV{TAR} ||= 'tar';-$ENV{LZ4} ||= 'lz4';-$ENV{GZIP_PROGRAM} ||= 'gzip';-
$ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}";
if ($ENV{PERL5LIB})
[application/pgp-signature] signature.asc (832B, ../Ybgo5ZWgqeUeW79F@paquier.xyz/3-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, andrew@dunslane.net, andres@anarazel.de, tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Check that we have a working tar before trying to use it
In-Reply-To: <Ybgo5ZWgqeUeW79F@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox