]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Drop skip-deps option
authorJan Janssen <medhefgo@web.de>
Thu, 10 Aug 2023 16:11:25 +0000 (18:11 +0200)
committerJan Janssen <medhefgo@web.de>
Wed, 23 Aug 2023 12:57:49 +0000 (14:57 +0200)
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.

.github/workflows/unit_tests.sh
meson.build
meson_options.txt
test/fuzz/meson.build
tools/oss-fuzz.sh

index 85e40f3d638f353f0799156b1252856dddcc2ab8..0985817b72e5cb047f56a22877f45854e6e40111 100755 (executable)
@@ -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)
index f749dc1e8c677b0505d788f8ab232b2b84e8830f..b25a127d9e9dc852fcc22b323f829ce6efde27e8 100644 (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'
index 95f046fb99e7b860f19c4b729802ab18ea474ee5..b8116bcedde12ec8e24a83982ecf12176e869f79 100644 (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')
index 11b91e30bb6921de74b0a801e1c587b8b8193864..45f777525c341edc7029063fb92d79e3afa6d08d 100644 (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])
index 419805de7a29462fb1571c408dfb1f9f4fb779bf..df3d39eba6d5bfb18a86e6b15e92d827eb80d1ca 100755 (executable)
@@ -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