]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ci: Simplify musl build setup
authorDaan De Meyer <daan@amutable.com>
Wed, 18 Feb 2026 11:46:16 +0000 (12:46 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 19 Feb 2026 19:04:06 +0000 (20:04 +0100)
No need to setup symlink farms, we can just use the host's /usr/include
now.

.github/workflows/build-test-musl.sh [deleted file]
.github/workflows/linter.yml
tools/setup-musl-build.sh [deleted file]

diff --git a/.github/workflows/build-test-musl.sh b/.github/workflows/build-test-musl.sh
deleted file mode 100755 (executable)
index a2c6d8e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-set -eux
-
-if ! command -v musl-gcc >/dev/null; then
-    echo "musl-gcc is not installed, skipping the test."
-    exit 77
-fi
-
-TMPDIR=$(mktemp -d)
-
-cleanup() (
-    set +e
-
-    if [[ -d "$TMPDIR" ]]; then
-        rm -rf "$TMPDIR"
-    fi
-)
-
-trap cleanup EXIT ERR INT TERM
-
-tools/setup-musl-build.sh "${TMPDIR}/build"
-ninja -v -C "${TMPDIR}/build"
index 885620a6615f6baeb7d1e5ef2a73784a604c2be6..ba293cf8be1356ff92f0d534ab2fa5c7a53c8da5 100644 (file)
@@ -81,4 +81,12 @@ jobs:
         run: mkosi box -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit --quiet
 
       - name: Build with musl
-        run: mkosi box -- .github/workflows/build-test-musl.sh
+        run: |
+          mkosi box -- \
+            env \
+            CC=musl-gcc \
+            CXX=musl-gcc \
+            CFLAGS="-idirafter /usr/include" \
+            CXXFLAGS="-idirafter /usr/include" \
+              meson setup -Dlibc=musl -Ddbus-interfaces-dir=no musl
+          mkosi box -- ninja -C musl
diff --git a/tools/setup-musl-build.sh b/tools/setup-musl-build.sh
deleted file mode 100755 (executable)
index d264cc7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-# Usage:
-#   tools/setup-musl-build.sh <build-directory> <options…>
-# E.g.
-#   tools/setup-musl-build.sh build-musl -Dbuildtype=debugoptimized && ninja -C build-musl
-
-set -eux
-
-BUILD_DIR="${1:?}"
-shift
-
-SETUP_DIR="${BUILD_DIR}/extra"
-
-LINKS=(
-    acl
-    archive.h
-    archive_entry.h
-    asm
-    asm-generic
-    audit-records.h
-    audit_logging.h
-    bpf
-    bzlib.h
-    curl
-    dwarf.h
-    elfutils
-    fido.h
-    gcrypt.h
-    gelf.h
-    gnutls
-    gpg-error.h
-    idn2.h
-    libaudit.h
-    libcryptsetup.h
-    libelf.h
-    libkmod.h
-    linux
-    lz4.h
-    lz4frame.h
-    lz4hc.h
-    lzma
-    lzma.h
-    microhttpd.h
-    mtd
-    openssl
-    pcre2.h
-    pwquality.h
-    qrencode.h
-    seccomp-syscalls.h
-    seccomp.h
-    security
-    selinux
-    sys/acl.h
-    tss2
-    xen
-    xkbcommon
-    zconf.h
-    zlib.h
-    zstd.h
-    zstd_errors.h
-)
-
-rm -rf "${SETUP_DIR}"
-for t in "${LINKS[@]}"; do
-    [[ -e /usr/include/"$t" ]]
-    link="${SETUP_DIR}/usr/include/${t}"
-    mkdir -p "${link%/*}"
-    ln -s /usr/include/"$t" "$link"
-done
-
-# Use an absolute path so that when we chdir into the build directory,
-# the path still works. This is easier than figuring out the relative path.
-[[ "${SETUP_DIR}" =~ ^/ ]] || SETUP_DIR="${PWD}/${SETUP_DIR}"
-
-CFLAGS="-idirafter ${SETUP_DIR}/usr/include"
-
-set -x
-env \
-    CC=musl-gcc \
-    CXX=musl-gcc \
-    CFLAGS="$CFLAGS" \
-    CXXFLAGS="$CFLAGS" \
-    meson setup --reconfigure -Ddbus-interfaces-dir=no -Dlibc=musl "${BUILD_DIR}" "${@}"