Skip to content

Commit aadbf82

Browse files
committed
Adjust behavior of some env settings for the TAP tests of MSVC
edc2332 has introduced in vcregress.pl some control on the environment variables LZ4, TAR and GZIP_PROGRAM to allow any TAP tests to be able use those commands. This makes the settings more consistent with src/Makefile.global.in, as the same default gets used for Make and MSVC builds. Each parameter can be changed in buildenv.pl, but as a default gets assigned after loading buldenv.pl, it is not possible to unset any of these, and using an empty value would not work with "||=" either. As some environments may not have a compatible command in their PATH (tar coming from MinGW is an issue, for one), this could break tests without an exit path to bypass any failing test. This commit changes things so as the default values for LZ4, TAR and GZIP_PROGRAM are assigned before loading buildenv.pl, not after. This way, we keep the same amount of compatibility as a GNU build with the same defaults, and it becomes possible to unset any of those values. While on it, this adds some documentation about those three variables in the section dedicated to the TAP tests for MSVC. Per discussion with Andrew Dunstan. Discussion: https://postgr.es/m/YbGYe483803il3X7@paquier.xyz Backpatch-through: 10
1 parent 0a56820 commit aadbf82

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed

doc/src/sgml/install-windows.sgml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,40 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib';
496496
</varlistentry>
497497
</variablelist>
498498
</para>
499+
500+
<para>
501+
Some of the TAP tests depend on a set of external commands that would
502+
optionally trigger tests related to them. Each one of those variables
503+
can be set or unset in <filename>buildenv.pl</filename>:
504+
<variablelist>
505+
<varlistentry>
506+
<term><varname>GZIP_PROGRAM</varname></term>
507+
<listitem><para>
508+
Path to a <application>gzip</application> command. The default is
509+
<literal>gzip</literal>, that would be the command found in
510+
<varname>PATH</varname>.
511+
</para></listitem>
512+
</varlistentry>
513+
514+
<varlistentry>
515+
<term><varname>LZ4</varname></term>
516+
<listitem><para>
517+
Path to a <application>lz4</application> command. The default is
518+
<literal>lz4</literal>, that would be the command found in
519+
<varname>PATH</varname>.
520+
</para></listitem>
521+
</varlistentry>
522+
523+
<varlistentry>
524+
<term><varname>TAR</varname></term>
525+
<listitem><para>
526+
Path to a <application>tar</application> command. The default is
527+
<literal>tar</literal>, that would be the command found in
528+
<varname>PATH</varname>.
529+
</para></listitem>
530+
</varlistentry>
531+
</variablelist>
532+
</para>
499533
</sect2>
500534

501535
</sect1>

src/tools/msvc/vcregress.pl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
do './src/tools/msvc/config_default.pl';
2929
do './src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl');
3030

31+
# These values are defaults that can be overridden by the calling environment
32+
# (see buildenv.pl processing below).
33+
# c.f. src/Makefile.global.in and configure.ac
34+
$ENV{GZIP_PROGRAM} ||= 'gzip';
35+
$ENV{LZ4} ||= 'lz4';
36+
$ENV{TAR} ||= 'tar';
37+
3138
# buildenv.pl is for specifying the build environment settings
3239
# it should contain lines like:
3340
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
@@ -65,13 +72,6 @@
6572
$ENV{with_krb_srvnam} = $config->{krb_srvnam} || 'postgres';
6673
$ENV{with_readline} = 'no';
6774

68-
# These values are defaults that can be overridden by the calling environment
69-
# (see buildenv.pl processing above).
70-
# c.f. src/Makefile.global.in and configure.ac
71-
$ENV{TAR} ||= 'tar';
72-
$ENV{LZ4} ||= 'lz4';
73-
$ENV{GZIP_PROGRAM} ||= 'gzip';
74-
7575
$ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}";
7676

7777
if ($ENV{PERL5LIB})

0 commit comments

Comments
 (0)