1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

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.
This commit is contained in:
Jan Janssen 2023-08-10 18:11:25 +02:00
parent 1e73a64a7a
commit 7f9a0d6d74
5 changed files with 17 additions and 16 deletions

View File

@ -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)

View File

@ -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'

View File

@ -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')

View File

@ -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])

View File

@ -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