On 20.12.23 12:40, Andres Freund wrote:
Hm, or perhaps we should just get rid of sed use altogether. The sepgsql case is trivially translateable to perl, and postprocess_dtrace.sed isn't much harder.
Maybe yeah, but also it seems fine as is and we can easily fix the present issue ...
OTOH, I actually don't think it's valid to not have sed when you have dtrace. Erroring out in a weird way in such an artificially constructed test doesn't really seem like a problem.
Agreed. So let's just make it not-required, and that should work. Updated patch set attached.
From ade66f6cee93ba070e6019bc7368d89884f7933c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <pe...@eisentraut.org> Date: Wed, 20 Dec 2023 16:36:12 +0100 Subject: [PATCH v2 1/2] meson: Make sed optional sed is used only if dtrace or selinux are enabled. Those options are only used on Unix platforms, which should have sed. But we don't want to make sed a hard requirement on Windows, which was the case in meson until now. This just changes sed to be not-required by meson. If you happen to use a system with, say, dtrace but without sed, you might get a slightly complicated error from meson during the build, but that seems better than making the requiredness a complicated conditional that will need to be maintained. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f816283301..3162d0343b 100644 --- a/meson.build +++ b/meson.build @@ -331,7 +331,7 @@ perl = find_program(get_option('PERL'), required: true, native: true) python = find_program(get_option('PYTHON'), required: true, native: true) flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35') bison = find_program(get_option('BISON'), native: true, version: '>= 2.3') -sed = find_program(get_option('SED'), 'sed', native: true) +sed = find_program(get_option('SED'), 'sed', native: true, required: false) prove = find_program(get_option('PROVE'), native: true, required: false) tar = find_program(get_option('TAR'), native: true) gzip = find_program(get_option('GZIP'), native: true) -- 2.43.0
From 2ba06a6414be2654b5a4f1cfae2b28e36cd1bcab Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <pe...@eisentraut.org> Date: Tue, 19 Dec 2023 16:20:41 +0100 Subject: [PATCH v2 2/2] meson: Make gzip and tar optional They are only used for some tests. The tests are already set to skip as appropriate if they are not available. --- contrib/basebackup_to_shell/meson.build | 4 ++-- meson.build | 4 ++-- src/bin/pg_basebackup/meson.build | 4 ++-- src/bin/pg_dump/meson.build | 2 +- src/bin/pg_verifybackup/meson.build | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/basebackup_to_shell/meson.build b/contrib/basebackup_to_shell/meson.build index a5488c3023..331ee1c9be 100644 --- a/contrib/basebackup_to_shell/meson.build +++ b/contrib/basebackup_to_shell/meson.build @@ -24,7 +24,7 @@ tests += { 'tests': [ 't/001_basic.pl', ], - 'env': {'GZIP_PROGRAM': gzip.path(), - 'TAR': tar.path()}, + 'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', + 'TAR': tar.found() ? tar.path() : '' }, }, } diff --git a/meson.build b/meson.build index 3162d0343b..4e98cbefe4 100644 --- a/meson.build +++ b/meson.build @@ -333,8 +333,8 @@ flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35') bison = find_program(get_option('BISON'), native: true, version: '>= 2.3') sed = find_program(get_option('SED'), 'sed', native: true, required: false) prove = find_program(get_option('PROVE'), native: true, required: false) -tar = find_program(get_option('TAR'), native: true) -gzip = find_program(get_option('GZIP'), native: true) +tar = find_program(get_option('TAR'), native: true, required: false) +gzip = find_program(get_option('GZIP'), native: true, required: false) program_lz4 = find_program(get_option('LZ4'), native: true, required: false) openssl = find_program(get_option('OPENSSL'), native: true, required: false) program_zstd = find_program(get_option('ZSTD'), native: true, required: false) diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build index c426173db3..5445903a5b 100644 --- a/src/bin/pg_basebackup/meson.build +++ b/src/bin/pg_basebackup/meson.build @@ -80,8 +80,8 @@ tests += { 'sd': meson.current_source_dir(), 'bd': meson.current_build_dir(), 'tap': { - 'env': {'GZIP_PROGRAM': gzip.path(), - 'TAR': tar.path(), + 'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', + 'TAR': tar.found() ? tar.path() : '', 'LZ4': program_lz4.found() ? program_lz4.path() : '', }, 'tests': [ diff --git a/src/bin/pg_dump/meson.build b/src/bin/pg_dump/meson.build index b6603e26a5..77d162cad4 100644 --- a/src/bin/pg_dump/meson.build +++ b/src/bin/pg_dump/meson.build @@ -90,7 +90,7 @@ tests += { 'bd': meson.current_build_dir(), 'tap': { 'env': { - 'GZIP_PROGRAM': gzip.path(), + 'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', 'LZ4': program_lz4.found() ? program_lz4.path() : '', 'ZSTD': program_zstd.found() ? program_zstd.path() : '', 'with_icu': icu.found() ? 'yes' : 'no', diff --git a/src/bin/pg_verifybackup/meson.build b/src/bin/pg_verifybackup/meson.build index 58f780d1a6..8049011566 100644 --- a/src/bin/pg_verifybackup/meson.build +++ b/src/bin/pg_verifybackup/meson.build @@ -22,8 +22,8 @@ tests += { 'sd': meson.current_source_dir(), 'bd': meson.current_build_dir(), 'tap': { - 'env': {'GZIP_PROGRAM': gzip.path(), - 'TAR': tar.path(), + 'env': {'GZIP_PROGRAM': gzip.found() ? gzip.path() : '', + 'TAR': tar.found() ? tar.path() : '', 'LZ4': program_lz4.found() ? program_lz4.path() : '', 'ZSTD': program_zstd.found() ? program_zstd.path() : ''}, 'tests': [ -- 2.43.0