diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh index 37594cb95e1..ec22bc081fc 100755 --- a/.github/workflows/unit_tests.sh +++ b/.github/workflows/unit_tests.sh @@ -63,16 +63,20 @@ for phase in "${PHASES[@]}"; do ninja -C build -v meson test -C build --print-errorlogs ;; - RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN) + RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN_NO_DEPS) MESON_ARGS=(--optimization=1) - if [[ "$phase" = "RUN_CLANG_ASAN_UBSAN" ]]; then + if [[ "$phase" =~ ^RUN_CLANG_ASAN_UBSAN ]]; then export CC=clang export CXX=clang++ # Build fuzzer regression tests only with clang (for now), # see: https://github.com/systemd/systemd/pull/15886#issuecomment-632689604 # -Db_lundef=false: See https://github.com/mesonbuild/meson/issues/764 MESON_ARGS+=(-Db_lundef=false -Dfuzz-tests=true) + + if [[ "$phase" == "RUN_CLANG_ASAN_UBSAN_NO_DEPS" ]]; then + MESON_ARGS+=(-Dskip-deps=true) + fi fi run_meson --fatal-meson-warnings -Dnobody-group=nogroup --werror -Dtests=unsafe -Db_sanitize=address,undefined "${MESON_ARGS[@]}" build ninja -C build -v diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d4a4f3c7234..3c8fb54850f 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - run_phase: [GCC, GCC_ASAN_UBSAN, CLANG, CLANG_ASAN_UBSAN] + run_phase: [GCC, GCC_ASAN_UBSAN, CLANG, CLANG_ASAN_UBSAN, CLANG_ASAN_UBSAN_NO_DEPS] cryptolib: [auto] include: - run_phase: GCC diff --git a/meson.build b/meson.build index 428ebb2102e..371a9ce751b 100644 --- a/meson.build +++ b/meson.build @@ -40,7 +40,7 @@ if want_ossfuzz and want_libfuzzer error('only one of oss-fuzz or llvm-fuzz can be specified') endif -skip_deps = want_ossfuzz +skip_deps = want_ossfuzz or get_option('skip-deps') fuzzer_build = want_ossfuzz or want_libfuzzer # Create a title-less summary section early, so it ends up first in the output. diff --git a/meson_options.txt b/meson_options.txt index fa8c0b5e3fa..5d635748d58 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -484,3 +484,6 @@ option('analyze', type: 'boolean', value: 'true', option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'], 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 ccd66c0ccf9..80362d41543 100644 --- a/test/fuzz/meson.build +++ b/test/fuzz/meson.build @@ -7,10 +7,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@'.format( + '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ -Dc_args=@2@ -Dcpp_args=@2@ -Dskip-deps=@3@'.format( get_option('optimization'), get_option('werror') ? '--werror' : '', - '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION' + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', + get_option('skip-deps') ), ' '.join(cc.cmd_array()), cxx_cmd])