1
0
mirror of https://github.com/systemd/systemd synced 2026-04-21 22:44:51 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Frantisek Sumsal
80ff956704
Merge pull request #22591 from evverx/no-deps
ci: build systemd without optional dependencies
2022-02-23 09:27:41 +00:00
Evgeny Vereshchagin
fb53316fde meson: pass skip-deps on to the fuzzers as well
they should be tested without optional dependecines as well. CIFuzz
kind of covers that but let's just make sure local builds are fine as
well.
2022-02-22 17:50:14 +00:00
Evgeny Vereshchagin
ca57d11652 ci: build systemd without optional dependencies
to catch issues like https://github.com/systemd/systemd/pull/22585#issuecomment-1047640155
2022-02-22 15:46:15 +00:00
Evgeny Vereshchagin
678ba02033 meson: allow skipping optional dependencies
mostly to make sure that systemd is buildable without some dependencies
but other than that it should make it easier to build it with MSan without
having to compile all the dependencies with MSan.
2022-02-22 11:17:21 +00:00
5 changed files with 14 additions and 6 deletions

View File

@ -63,16 +63,20 @@ for phase in "${PHASES[@]}"; do
ninja -C build -v ninja -C build -v
meson test -C build --print-errorlogs 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) MESON_ARGS=(--optimization=1)
if [[ "$phase" = "RUN_CLANG_ASAN_UBSAN" ]]; then if [[ "$phase" =~ ^RUN_CLANG_ASAN_UBSAN ]]; then
export CC=clang export CC=clang
export CXX=clang++ export CXX=clang++
# Build fuzzer regression tests only with clang (for now), # Build fuzzer regression tests only with clang (for now),
# see: https://github.com/systemd/systemd/pull/15886#issuecomment-632689604 # see: https://github.com/systemd/systemd/pull/15886#issuecomment-632689604
# -Db_lundef=false: See https://github.com/mesonbuild/meson/issues/764 # -Db_lundef=false: See https://github.com/mesonbuild/meson/issues/764
MESON_ARGS+=(-Db_lundef=false -Dfuzz-tests=true) MESON_ARGS+=(-Db_lundef=false -Dfuzz-tests=true)
if [[ "$phase" == "RUN_CLANG_ASAN_UBSAN_NO_DEPS" ]]; then
MESON_ARGS+=(-Dskip-deps=true)
fi
fi fi
run_meson --fatal-meson-warnings -Dnobody-group=nogroup --werror -Dtests=unsafe -Db_sanitize=address,undefined "${MESON_ARGS[@]}" build run_meson --fatal-meson-warnings -Dnobody-group=nogroup --werror -Dtests=unsafe -Db_sanitize=address,undefined "${MESON_ARGS[@]}" build
ninja -C build -v ninja -C build -v

View File

@ -21,7 +21,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: 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] cryptolib: [auto]
include: include:
- run_phase: GCC - run_phase: GCC

View File

@ -40,7 +40,7 @@ if want_ossfuzz and want_libfuzzer
error('only one of oss-fuzz or llvm-fuzz can be specified') error('only one of oss-fuzz or llvm-fuzz can be specified')
endif endif
skip_deps = want_ossfuzz skip_deps = want_ossfuzz or get_option('skip-deps')
fuzzer_build = want_ossfuzz or want_libfuzzer fuzzer_build = want_ossfuzz or want_libfuzzer
# Create a title-less summary section early, so it ends up first in the output. # Create a title-less summary section early, so it ends up first in the output.

View File

@ -484,3 +484,6 @@ option('analyze', type: 'boolean', value: 'true',
option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'], option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'],
description: 'build BPF programs from source code in restricted C') description: 'build BPF programs from source code in restricted C')
option('skip-deps', type : 'boolean', value : 'false',
description : 'skip optional dependencies')

View File

@ -7,10 +7,11 @@ sanitize_address_undefined = custom_target(
project_source_root, project_source_root,
'@OUTPUT@', '@OUTPUT@',
'fuzzers', '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('optimization'),
get_option('werror') ? '--werror' : '', get_option('werror') ? '--werror' : '',
'-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION' '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION',
get_option('skip-deps')
), ),
' '.join(cc.cmd_array()), ' '.join(cc.cmd_array()),
cxx_cmd]) cxx_cmd])