summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2023-08-10 18:11:25 +0200
committerJan Janssen <medhefgo@web.de>2023-08-23 14:57:49 +0200
commit7f9a0d6d74588c70af87683cd5d7c21b51c782b8 (patch)
treed9f921d9e35ff90611fe03b2868f2026e4100c05
parentmeson: Convert more options to meson features (diff)
downloadsystemd-7f9a0d6d74588c70af87683cd5d7c21b51c782b8.tar.xz
systemd-7f9a0d6d74588c70af87683cd5d7c21b51c782b8.zip
meson: Drop skip-deps option
Now that we use meson feature options for our dependencies, we can just rely on '--auto-features=disabled' to do the same. One benefit of this is that specific features can still be force-enabled by overriding it with the appropriate '-Dfeature=enabled' flag. The two remaining uses for skip-deps can simply rely on their default logic that sets the value to 'no' when the dependency is disabled.
-rwxr-xr-x.github/workflows/unit_tests.sh2
-rw-r--r--meson.build7
-rw-r--r--meson_options.txt3
-rw-r--r--test/fuzz/meson.build13
-rwxr-xr-xtools/oss-fuzz.sh8
5 files changed, 17 insertions, 16 deletions
diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh
index 85e40f3d63..0985817b72 100755
--- a/.github/workflows/unit_tests.sh
+++ b/.github/workflows/unit_tests.sh
@@ -87,7 +87,7 @@ for phase in "${PHASES[@]}"; do
MESON_ARGS+=(-Db_lundef=false -Dfuzz-tests=true)
if [[ "$phase" == "RUN_CLANG_ASAN_UBSAN_NO_DEPS" ]]; then
- MESON_ARGS+=(-Dskip-deps=true)
+ MESON_ARGS+=(--auto-features=disabled)
fi
fi
MESON_ARGS+=(--fatal-meson-warnings)
diff --git a/meson.build b/meson.build
index f749dc1e8c..b25a127d9e 100644
--- a/meson.build
+++ b/meson.build
@@ -47,7 +47,6 @@ if want_ossfuzz and want_libfuzzer
error('only one of oss-fuzz or llvm-fuzz can be specified')
endif
-skip_deps = want_ossfuzz or get_option('skip-deps')
fuzzer_build = want_ossfuzz or want_libfuzzer
# If we're building *not* for actual fuzzing, allow input samples of any size
@@ -1484,9 +1483,6 @@ conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls)
conf.set10('DNS_OVER_TLS_USE_OPENSSL', have_openssl)
default_dns_over_tls = get_option('default-dns-over-tls')
-if skip_deps
- default_dns_over_tls = 'no'
-endif
if default_dns_over_tls != 'no' and conf.get('ENABLE_DNS_OVER_TLS') == 0
message('default-dns-over-tls cannot be enabled or set to opportunistic when DNS-over-TLS support is disabled. Setting default-dns-over-tls to no.')
default_dns_over_tls = 'no'
@@ -1511,9 +1507,6 @@ have = get_option('repart').require(
conf.set10('ENABLE_REPART', have)
default_dnssec = get_option('default-dnssec')
-if skip_deps
- default_dnssec = 'no'
-endif
if default_dnssec != 'no' and conf.get('HAVE_OPENSSL_OR_GCRYPT') == 0
message('default-dnssec cannot be set to yes or allow-downgrade openssl and gcrypt are disabled. Setting default-dnssec to no.')
default_dnssec = 'no'
diff --git a/meson_options.txt b/meson_options.txt
index 95f046fb99..b8116bcedd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -506,6 +506,3 @@ option('bpf-compiler', type : 'combo', choices : ['clang', 'gcc'],
description: 'compiler used to build BPF programs')
option('bpf-framework', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
description: 'build BPF programs from source code in restricted C')
-
-option('skip-deps', type : 'boolean', value : false,
- description : 'skip optional dependencies')
diff --git a/test/fuzz/meson.build b/test/fuzz/meson.build
index 11b91e30bb..45f777525c 100644
--- a/test/fuzz/meson.build
+++ b/test/fuzz/meson.build
@@ -36,6 +36,15 @@ fuzz_regression_tests += { 'fuzz-unit-file' : dict }
############################################################
+# TODO: Use native string formatting with meson >= 1.3.0
+if get_option('auto_features').enabled()
+ sanitize_auto_features = 'enabled'
+elif get_option('auto_features').disabled()
+ sanitize_auto_features = 'disabled'
+else
+ sanitize_auto_features = 'auto'
+endif
+
sanitize_address_undefined = custom_target(
'sanitize-address-undefined-fuzzers',
output : 'sanitize-address-undefined-fuzzers',
@@ -43,11 +52,11 @@ sanitize_address_undefined = custom_target(
project_source_root,
'@OUTPUT@',
'fuzzers',
- '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ -Dc_args=@2@ -Dcpp_args=@2@ -Dskip-deps=@3@'.format(
+ '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ -Dc_args=@2@ -Dcpp_args=@2@ --auto-features=@3@'.format(
get_option('optimization'),
get_option('werror') ? '--werror' : '',
'-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION',
- get_option('skip-deps')
+ sanitize_auto_features
),
' '.join(cc.cmd_array()),
cxx_cmd])
diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
index 419805de7a..df3d39eba6 100755
--- a/tools/oss-fuzz.sh
+++ b/tools/oss-fuzz.sh
@@ -27,10 +27,12 @@ build="$WORK/build"
rm -rf "$build"
mkdir -p "$build"
+meson_args=("-Db_lundef=false")
+
if [ -z "$FUZZING_ENGINE" ]; then
- fuzzflag="llvm-fuzz=true"
+ meson_args+=("-Dllvm-fuzz=true")
else
- fuzzflag="oss-fuzz=true"
+ meson_args+=("-Doss-fuzz=true" "--auto-features=disabled")
apt-get update
apt-get install -y gperf m4 gettext python3-pip \
@@ -67,7 +69,7 @@ else
fi
fi
-if ! meson setup "$build" "-D$fuzzflag" -Db_lundef=false; then
+if ! meson setup "$build" "${meson_args[@]}"; then
cat "$build/meson-logs/meson-log.txt"
exit 1
fi