mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-10 00:58:20 +03:00
Merge pull request #24254 from medhefgo/mold
ci: Add mold to build tests
This commit is contained in:
commit
5e98346220
26
.github/workflows/build_test.sh
vendored
26
.github/workflows/build_test.sh
vendored
@ -45,6 +45,7 @@ PACKAGES=(
|
|||||||
libxkbcommon-dev
|
libxkbcommon-dev
|
||||||
libxtables-dev
|
libxtables-dev
|
||||||
libzstd-dev
|
libzstd-dev
|
||||||
|
mold
|
||||||
mount
|
mount
|
||||||
net-tools
|
net-tools
|
||||||
perl
|
perl
|
||||||
@ -121,27 +122,28 @@ ninja --version
|
|||||||
for args in "${ARGS[@]}"; do
|
for args in "${ARGS[@]}"; do
|
||||||
SECONDS=0
|
SECONDS=0
|
||||||
|
|
||||||
# meson fails with
|
|
||||||
# src/boot/efi/meson.build:52: WARNING: Not using lld as efi-ld, falling back to bfd
|
|
||||||
# src/boot/efi/meson.build:52:16: ERROR: Fatal warnings enabled, aborting
|
|
||||||
# when LINKER is set to lld so let's just not turn meson warnings into errors with lld
|
|
||||||
# to make sure that the build systemd can pick up the correct efi-ld linker automatically.
|
|
||||||
|
|
||||||
# The install_tag feature introduced in 0.60 causes meson to fail with fatal-meson-warnings
|
# The install_tag feature introduced in 0.60 causes meson to fail with fatal-meson-warnings
|
||||||
# "Project targeting '>= 0.53.2' but tried to use feature introduced in '0.60.0': install_tag arg in custom_target"
|
# "Project targeting '>= 0.53.2' but tried to use feature introduced in '0.60.0': install_tag arg in custom_target"
|
||||||
# It can be safely removed from the CI since it isn't actually used anywhere to test anything.
|
# It can be safely removed from the CI since it isn't actually used anywhere to test anything.
|
||||||
find . -type f -name meson.build -exec sed -i '/install_tag/d' '{}' '+'
|
find . -type f -name meson.build -exec sed -i '/install_tag/d' '{}' '+'
|
||||||
if [[ "$LINKER" != lld ]]; then
|
|
||||||
additional_meson_args="--fatal-meson-warnings"
|
# mold < 1.1 does not support LTO.
|
||||||
|
if dpkg --compare-versions "$(dpkg-query --showformat='${Version}' --show mold)" ge 1.1; then
|
||||||
|
fatal "Newer mold version detected, please remove this workaround."
|
||||||
|
elif [[ "$args" == *"-Db_lto=true"* ]]; then
|
||||||
|
LD="gold"
|
||||||
|
else
|
||||||
|
LD="$LINKER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Checking build with $args"
|
info "Checking build with $args"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if ! AR="$AR" \
|
if ! AR="$AR" \
|
||||||
CC="$CC" CC_LD="$LINKER" CFLAGS="-Werror" \
|
CC="$CC" CC_LD="$LD" CFLAGS="-Werror" \
|
||||||
CXX="$CXX" CXX_LD="$LINKER" CXXFLAGS="-Werror" \
|
CXX="$CXX" CXX_LD="$LD" CXXFLAGS="-Werror" \
|
||||||
meson -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true --werror \
|
meson -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true --werror \
|
||||||
-Dnobody-group=nogroup $additional_meson_args \
|
-Dnobody-group=nogroup -Dcryptolib="${CRYPTOLIB:?}" \
|
||||||
-Dcryptolib="${CRYPTOLIB:?}" $args build; then
|
$args build; then
|
||||||
|
|
||||||
cat build/meson-logs/meson-log.txt
|
cat build/meson-logs/meson-log.txt
|
||||||
fatal "meson failed with $args"
|
fatal "meson failed with $args"
|
||||||
|
2
.github/workflows/build_test.yml
vendored
2
.github/workflows/build_test.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
- { COMPILER: "gcc", COMPILER_VERSION: "11", LINKER: "bfd", CRYPTOLIB: "gcrypt" }
|
- { COMPILER: "gcc", COMPILER_VERSION: "11", LINKER: "bfd", CRYPTOLIB: "gcrypt" }
|
||||||
- { COMPILER: "gcc", COMPILER_VERSION: "12", LINKER: "gold", CRYPTOLIB: "openssl" }
|
- { COMPILER: "gcc", COMPILER_VERSION: "12", LINKER: "gold", CRYPTOLIB: "openssl" }
|
||||||
- { COMPILER: "clang", COMPILER_VERSION: "13", LINKER: "gold", CRYPTOLIB: "gcrypt" }
|
- { COMPILER: "clang", COMPILER_VERSION: "13", LINKER: "mold", CRYPTOLIB: "gcrypt" }
|
||||||
- { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "lld", CRYPTOLIB: "openssl" }
|
- { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "lld", CRYPTOLIB: "openssl" }
|
||||||
- { COMPILER: "clang", COMPILER_VERSION: "15", LINKER: "bfd", CRYPTOLIB: "auto" }
|
- { COMPILER: "clang", COMPILER_VERSION: "15", LINKER: "bfd", CRYPTOLIB: "auto" }
|
||||||
env: ${{ matrix.env }}
|
env: ${{ matrix.env }}
|
||||||
|
@ -60,7 +60,7 @@ efi_ld = get_option('efi-ld')
|
|||||||
if efi_ld == 'auto'
|
if efi_ld == 'auto'
|
||||||
efi_ld = cc.get_linker_id().split('.')[1]
|
efi_ld = cc.get_linker_id().split('.')[1]
|
||||||
if efi_ld not in ['bfd', 'gold']
|
if efi_ld not in ['bfd', 'gold']
|
||||||
warning('Not using @0@ as efi-ld, falling back to bfd'.format(efi_ld))
|
message('Not using @0@ as efi-ld, falling back to bfd'.format(efi_ld))
|
||||||
efi_ld = 'bfd'
|
efi_ld = 'bfd'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user