Hi,
On 2023-02-23 06:27:23 -0500, Andrew Dunstan wrote:
> Yeah. For touch I think we can probably just get rid of this line in the
> root meson.build:
>
> touch = find_program('touch', native: true)
Yep.
> For cp there doesn't seem to be a formal requirement, but there is a recipe
> in src/common/unicode/meson.build that uses it, maybe that's what caused the
> failure. On Windows/msvc we could just use copy instead, I think.
I don't know about using copy, it's very easy to get into trouble due to
interpreting forward slashes as options etc. I propose that for now we just
don't support update-unicode if cp isn't available - just as already not
available when wget isn't available.
Planning to apply something like the attached soon, unless somebody opposes
that plan.
Other unix tools we have a hard requirement on right now:
- sed - would be pretty easy to replace with something else
- tar, gzip - just for tests
I'm not sure it's worth working on not requiring those.
There's also flex, bison, perl, but those will stay a hard requirement for a
while longer... :)
Greetings,
Andres Freund
>From 564092bfb4c108c387cac3562a7dbad8c3126fea Mon Sep 17 00:00:00 2001
From: Andres Freund <[email protected]>
Date: Tue, 7 Mar 2023 18:24:18 -0800
Subject: [PATCH] meson: don't require 'touch' binary, make use of 'cp'
optional
---
meson.build | 2 +-
src/common/unicode/meson.build | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 87cb974ad7c..f1ce4cb8e03 100644
--- a/meson.build
+++ b/meson.build
@@ -333,11 +333,11 @@ 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)
program_lz4 = find_program(get_option('LZ4'), native: true, required: false)
-touch = find_program('touch', native: true)
openssl = find_program(get_option('OPENSSL'), native: true, required: false)
program_zstd = find_program(get_option('ZSTD'), native: true, required: false)
dtrace = find_program(get_option('DTRACE'), native: true, required: get_option('dtrace'))
missing = find_program('config/missing', native: true)
+cp = find_program('cp', required: false, native: true)
bison_flags = []
if bison.found()
diff --git a/src/common/unicode/meson.build b/src/common/unicode/meson.build
index 63c81664de3..1ffece1550a 100644
--- a/src/common/unicode/meson.build
+++ b/src/common/unicode/meson.build
@@ -5,7 +5,7 @@ UNICODE_VERSION = '15.0.0'
unicode_data = {}
unicode_baseurl = 'https://www.unicode.org/Public/@0@/ucd/@1@'
-if not wget.found()
+if not wget.found() or not cp.found()
subdir_done()
endif
@@ -100,7 +100,7 @@ update_unicode = custom_target('update-unicode',
depends: update_unicode_dep,
output: ['dont-exist'],
input: update_unicode_targets,
- command: ['cp', '@INPUT@', '@SOURCE_ROOT@/src/include/common/'],
+ command: [cp, '@INPUT@', '@SOURCE_ROOT@/src/include/common/'],
build_by_default: false,
build_always_stale: true,
)
--
2.38.0