pgsql: Improve setup of environment values for commands in MSVC's vcreg

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Improve setup of environment values for commands in MSVC's vcreg
Дата
Msg-id E1nob5L-0005dL-UZ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f0fb2e9509e90322dfc73f9a817f1488afa03bf6

Modified Files
--------------
doc/src/sgml/install-windows.sgml |  9 ---------
src/tools/msvc/vcregress.pl       | 39 ++++++++++++++++++++++++++++++++++++---
2 files changed, 36 insertions(+), 12 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: pgsql: Specialize tuplesort routines for different kinds of abbreviated
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pgsql: Remove command checks in tests of pg_basebackup and pg_receivewa