From b9d70ef34b833fd63e3ff9f049dbbcdfda9dc9fe Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 11 May 2022 10:22:34 +0900 Subject: Improve setup of environment values for commands in MSVC's vcregress.pl The current setup assumes that commands for lz4, zstd and gzip always exist by default if not enforced by a user's environment. However, vcpkg, as one example, installs libraries but no binaries, so this default setup to assume that a command should always be present would cause failures. This commit improves the detection of such external commands as follows: * If a ENV value is available, trust the environment/user and use it. * If a ENV value is not available, check its execution by looking in the current PATH, by launching a simple "$command --version" (that should be portable enough). ** On execution failure, ignore ENV{command}. ** On execution success, set ENV{command} = "$command". Note that this new rule applies to gzip, lz4 and zstd but not tar that we assume will always exist. Those commands are set up in the environment only when using bincheck and taptest. The CI includes all those commands and I have checked that their setup is correct there. I have also tested this change in a MSVC environment where we have none of those commands. While on it, remove the references to lz4 from the documentation and vcregress.pl in ~v13. --with-lz4 has been added in v14~ so there is no point to have this information in these older branches. Reported-by: Andrew Dunstan Reviewed-by: Andrew Dunstan Discussion: https://postgr.es/m/14402151-376b-a57a-6d0c-10ad12608e12@dunslane.net Backpatch-through: 10 --- doc/src/sgml/install-windows.sgml | 9 --------- 1 file changed, 9 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index dff58c2f8ad..7e99d0c5329 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -511,15 +511,6 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib'; - - LZ4 - - Path to a lz4 command. The default is - lz4, that would be the command found in - PATH. - - - TAR -- cgit v1.2.3