Apple Clang rendered bench 5-8% faster with it, with no new warnings, so REAKTOR_LTO now defaults to ON there as with MSVC. The macOS release builds its static libreaktor with it off, as the Windows release does, since its objects link only with the same compiler. GCC (69 new warnings in dependencies) and Clang on Linux (no gain, +8.6% size) stay off. The decision made, tools/ci/lto-check.sh and its dispatch-only jobs go; PERFORMANCE.md keeps the 2026-11-10 numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
419 lines
18 KiB
YAML
419 lines
18 KiB
YAML
name: Linux
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
type: string
|
|
default: ''
|
|
strict:
|
|
type: boolean
|
|
default: false
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: linux-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
linux:
|
|
name: linux ${{ matrix.arch }}
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: ${{ matrix.timeout }}
|
|
continue-on-error: ${{ matrix.emulated && !inputs.strict }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { arch: x86-64, platform: linux/amd64, image: 'debian:bookworm', runner: ubuntu-24.04, emulated: false, timeout: 60 }
|
|
- { arch: x86, platform: linux/386, image: 'debian:bookworm', runner: ubuntu-24.04, emulated: false, timeout: 60 }
|
|
- { arch: arm64, platform: linux/arm64, image: 'debian:bookworm', runner: ubuntu-24.04-arm, emulated: false, timeout: 60 }
|
|
|
|
steps: &linux-steps
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
|
|
- name: Set up QEMU
|
|
if: ${{ matrix.emulated }}
|
|
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
|
|
with:
|
|
platforms: ${{ matrix.platform }}
|
|
|
|
- name: Start Debian
|
|
id: debian
|
|
run: |
|
|
docker run -d --name debian --platform ${{ matrix.platform }} \
|
|
-v "$PWD:/src" -w /src ${{ matrix.image }} sleep infinity
|
|
docker exec debian sh -c 'uname -m; cat /etc/debian_version'
|
|
|
|
- name: Install packages
|
|
run: |
|
|
docker exec -i debian sh -eu <<'EOF'
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
apt-get update </dev/null
|
|
apt-get install -y --no-install-recommends \
|
|
cmake ninja-build gcc g++ pkgconf file diffutils \
|
|
libx11-dev libxext-dev libxcursor-dev libxi-dev libxfixes-dev \
|
|
libxrandr-dev libxrender-dev libxtst-dev libxkbcommon-dev \
|
|
libwayland-dev wayland-protocols libegl-dev libdbus-1-dev \
|
|
dbus xvfb xauth ccache gdb </dev/null
|
|
EOF
|
|
|
|
# ccache only: the build folder is rebuilt, so a stale cache cannot hide a broken one.
|
|
- name: Restore the compiler cache
|
|
id: ccache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: .ccache
|
|
key: ccache-linux-${{ matrix.arch }}-${{ matrix.image }}-${{ github.run_id }}
|
|
restore-keys: ccache-linux-${{ matrix.arch }}-${{ matrix.image }}-
|
|
|
|
- name: Start the cross builder
|
|
if: ${{ matrix.emulated }}
|
|
run: |
|
|
docker run -d --name builder --platform linux/amd64 -v "$PWD:/src" -w /src ${{ matrix.image }} sleep infinity
|
|
docker exec -i -e A=${{ matrix.debarch }} builder sh -eu <<'EOF'
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
dpkg --add-architecture "$A"
|
|
apt-get update </dev/null
|
|
apt-get install -y --no-install-recommends cmake ninja-build pkgconf file ccache crossbuild-essential-"$A" libwayland-bin wayland-protocols libx11-dev:"$A" libxext-dev:"$A" libxcursor-dev:"$A" libxi-dev:"$A" libxfixes-dev:"$A" libxrandr-dev:"$A" libxrender-dev:"$A" libxtst-dev:"$A" libxkbcommon-dev:"$A" libwayland-dev:"$A" libegl-dev:"$A" libdbus-1-dev:"$A" </dev/null
|
|
EOF
|
|
|
|
- name: Build
|
|
id: build
|
|
run: |
|
|
ctr=debian
|
|
cross=""
|
|
if [ "${{ matrix.emulated }}" = true ]; then
|
|
ctr=builder
|
|
cross="-DCMAKE_TOOLCHAIN_FILE=/src/tools/cross/linux-cross.cmake -DREAKTOR_CROSS_TRIPLE=${{ matrix.triple }}"
|
|
fi
|
|
version='${{ inputs.version || 'dev' }}'
|
|
docker exec -i -e CROSS="$cross" -e TRIPLE="${{ matrix.triple }}" -e LIBNAME="libreaktor-${version}-linux-${{ matrix.arch }}" "$ctr" sh -eu <<'EOF'
|
|
uname -a
|
|
cmake --version
|
|
export CCACHE_DIR=/src/.ccache CCACHE_BASEDIR=/src CCACHE_MAXSIZE=500M
|
|
ccache -z
|
|
./build.sh -- -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON $CROSS </dev/null
|
|
cmake --build build --target libreaktor </dev/null
|
|
ccache -s
|
|
file build/showcase
|
|
dump=objdump
|
|
if [ -n "$CROSS" ]; then
|
|
dump=$TRIPLE-objdump
|
|
# The emulated machine has none of the cross compiler's headers, so
|
|
# anything that builds stays here.
|
|
cmake --install build --prefix "dist/$LIBNAME" --component libreaktor </dev/null
|
|
fi
|
|
echo "needs $($dump -T build/showcase | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1)"
|
|
EOF
|
|
|
|
- name: Save the compiler cache
|
|
if: ${{ always() && steps.build.outcome == 'success' }}
|
|
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: .ccache
|
|
key: ${{ steps.ccache.outputs.cache-primary-key }}
|
|
|
|
- name: Console tests
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: |
|
|
docker exec -i debian sh -u <<'EOF'
|
|
fail=0
|
|
for t in $(cat tools/ci/tests.txt); do
|
|
echo "== $t"
|
|
a=; [ "$t" = gibustest ] && a=--require-bus
|
|
if ./build/$t $a </dev/null; then :; else echo "$t: exit status $?"; fail=1; fi
|
|
done
|
|
exit "$fail"
|
|
EOF
|
|
|
|
- name: Shots and dumps
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: |
|
|
docker exec -i debian sh -u tools/ci/shots.sh -x Xvfb -w "dbus-run-session -- timeout 600" build x11 </dev/null
|
|
|
|
- name: One copy at a time
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
run: docker exec -i debian sh tools/ci/instance.sh -w "dbus-run-session -- timeout 120" build </dev/null
|
|
|
|
- name: Scripted UI test
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
run: docker exec -i debian sh tools/ci/uitest.sh -w "dbus-run-session -- timeout 120" build </dev/null
|
|
|
|
- name: What a shared libreaktor would save
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
continue-on-error: true
|
|
run: docker exec -i debian sh tools/ci/pss.sh -x Xvfb -w "dbus-run-session -- timeout 120" build </dev/null
|
|
|
|
- name: What a shared libreaktor would save, page by page
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
continue-on-error: true
|
|
run: docker exec -i debian sh tools/ci/pss-pages.sh -x Xvfb -w "dbus-run-session -- timeout 120" </dev/null
|
|
|
|
- name: Shared libreaktor
|
|
id: shared
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: |
|
|
ctr=debian
|
|
cross=""
|
|
if [ "${{ matrix.emulated }}" = true ]; then
|
|
ctr=builder
|
|
cross="-DCMAKE_TOOLCHAIN_FILE=/src/tools/cross/linux-cross.cmake -DREAKTOR_CROSS_TRIPLE=${{ matrix.triple }}"
|
|
fi
|
|
version='${{ inputs.version || 'dev' }}'
|
|
name="libreaktor-shared-${version}-linux-${{ matrix.arch }}"
|
|
docker exec -i -e CROSS="$cross" -e LIBNAME="$name" "$ctr" sh -eu <<'EOF'
|
|
export CCACHE_DIR=/src/.ccache CCACHE_BASEDIR=/src CCACHE_MAXSIZE=500M
|
|
cmake -S . -B build-shared -G Ninja -DCMAKE_BUILD_TYPE=Release -DREAKTOR_SHARED=ON \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON $CROSS </dev/null
|
|
cmake --build build-shared --target all libreaktor </dev/null
|
|
if [ -n "$CROSS" ]; then
|
|
cmake --install build-shared --prefix "dist/$LIBNAME" --component libreaktor --strip </dev/null
|
|
else
|
|
sh tools/ci/check-exports.sh build-shared </dev/null
|
|
fi
|
|
EOF
|
|
installed=""
|
|
if [ "${{ matrix.emulated }}" = true ]; then installed=-i; fi
|
|
docker exec -i debian sh -eu tools/ci/check-libreaktor.sh $installed -w "timeout 600" build-shared "$name" </dev/null
|
|
|
|
- name: Upload the shared libreaktor
|
|
if: ${{ !cancelled() && steps.shared.outcome == 'success' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: package-libreaktor-shared-linux-${{ matrix.arch }}
|
|
path: |
|
|
dist/libreaktor-shared-*.tar.gz
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
- name: ABI table
|
|
id: abi
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && !matrix.emulated }}
|
|
run: |
|
|
rc=0
|
|
docker exec -i debian sh tools/ci/check-abi.sh </dev/null || rc=$?
|
|
if [ "$rc" = 3 ]; then echo "::warning::no ABI table for linux ${{ matrix.arch }} yet; see the abi artifact"; rc=0; fi
|
|
exit "$rc"
|
|
|
|
- name: Upload the ABI table
|
|
if: ${{ !cancelled() && hashFiles('smoke/abi/*.abi') != '' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: abi-linux-${{ matrix.arch }}
|
|
path: smoke/abi/
|
|
|
|
- name: Package
|
|
id: package
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: |
|
|
version='${{ inputs.version || 'dev' }}'
|
|
docker exec -i debian sh -eu tools/ci/check-package.sh -w "timeout 600" build "reaktor-${version}-linux-${{ matrix.arch }}" </dev/null
|
|
|
|
- name: Upload the package
|
|
if: ${{ !cancelled() && steps.package.outcome == 'success' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: package-linux-${{ matrix.arch }}
|
|
path: dist/reaktor-*.tar.gz
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
- name: Check and pack libreaktor
|
|
id: libcheck
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
|
run: |
|
|
version='${{ inputs.version || 'dev' }}'
|
|
installed=""
|
|
if [ "${{ matrix.emulated }}" = true ]; then installed=-i; fi
|
|
docker exec -i debian sh -eu tools/ci/check-libreaktor.sh $installed -w "timeout 600" build "libreaktor-${version}-linux-${{ matrix.arch }}" </dev/null
|
|
|
|
- name: Pack libreaktor as a .deb
|
|
id: deb
|
|
if: ${{ !cancelled() && steps.libcheck.outcome == 'success' }}
|
|
run: |
|
|
if [ "${{ matrix.emulated }}" = true ]; then
|
|
docker exec -i builder sh -eu tools/libreaktor-pkg.sh -f deb -b build -o dist-pkg -a ${{ matrix.debarch }} </dev/null
|
|
else
|
|
docker exec -i debian sh -eu tools/libreaktor-pkg.sh -f deb -b build -o dist-pkg </dev/null
|
|
fi
|
|
|
|
- name: Upload the .deb
|
|
if: ${{ !cancelled() && steps.deb.outcome == 'success' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: package-deb-linux-${{ matrix.arch }}
|
|
path: dist-pkg/*.deb
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
- name: Check the libreaktor .deb
|
|
if: ${{ !cancelled() && steps.deb.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
run: |
|
|
docker exec -i debian sh -eu <<'EOF'
|
|
dpkg -i dist-pkg/*.deb </dev/null
|
|
dpkg -s libreaktor | grep -q '^Status: install ok installed'
|
|
cmake -S examples/consumer -B build-pkg-consumer -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_PREFIX_PATH=/opt/reaktor </dev/null
|
|
cmake --build build-pkg-consumer </dev/null
|
|
timeout 600 build-pkg-consumer/simple --theme light --video dummy \
|
|
--shot check/lib-packaged.bmp --a11y-dump check/lib-packaged.txt </dev/null
|
|
for e in bmp txt; do cmp "check/lib-built.$e" "check/lib-packaged.$e"; done
|
|
EOF
|
|
|
|
- name: Pack the shared libreaktor as .debs
|
|
id: shareddeb
|
|
if: ${{ !cancelled() && steps.shared.outcome == 'success' }}
|
|
run: |
|
|
if [ "${{ matrix.emulated }}" = true ]; then
|
|
docker exec -i builder sh -eu tools/libreaktor-pkg.sh -f deb -b build-shared -o dist-pkg-shared -a ${{ matrix.debarch }} </dev/null
|
|
else
|
|
docker exec -i debian sh -eu tools/libreaktor-pkg.sh -f deb -b build-shared -o dist-pkg-shared </dev/null
|
|
fi
|
|
|
|
- name: Upload the shared .debs
|
|
if: ${{ !cancelled() && steps.shareddeb.outcome == 'success' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: package-deb-shared-linux-${{ matrix.arch }}
|
|
path: dist-pkg-shared/*.deb
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
- name: Check the shared libreaktor .debs
|
|
if: ${{ !cancelled() && steps.shareddeb.outcome == 'success' && steps.libcheck.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
run: |
|
|
docker exec -i debian sh -eu <<'EOF'
|
|
dpkg -r libreaktor </dev/null
|
|
dpkg -i dist-pkg-shared/*.deb </dev/null
|
|
cmake -S examples/consumer -B build-pkg-shared -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_PREFIX_PATH=/opt/reaktor -DCONSUMER_SHARED=ON </dev/null
|
|
cmake --build build-pkg-shared </dev/null
|
|
dpkg -r libreaktor-shared </dev/null
|
|
dpkg -s libreaktor1 libreaktor-sdl3-0 | grep -c '^Status: install ok installed' | grep -q 2
|
|
timeout 600 build-pkg-shared/simple --theme light --video dummy \
|
|
--shot check/lib-packaged-shared.bmp --a11y-dump check/lib-packaged-shared.txt </dev/null
|
|
for e in bmp txt; do cmp "check/lib-built.$e" "check/lib-packaged-shared.$e"; done
|
|
EOF
|
|
|
|
- name: Check an app that embeds Reaktor
|
|
if: ${{ !cancelled() && steps.build.outcome == 'success' && matrix.arch == 'x86-64' }}
|
|
run: |
|
|
docker exec -i debian sh -eu <<'EOF'
|
|
cmake -S examples/embedded -B build-embedded -G Ninja -DCMAKE_BUILD_TYPE=Release </dev/null
|
|
cmake --build build-embedded --target simple </dev/null
|
|
mkdir -p check
|
|
for from in "tree build/simple" "embedded build-embedded/simple"; do
|
|
set -- $from
|
|
timeout 600 dbus-run-session -- "$2" --theme light --video dummy \
|
|
--shot "check/$1.bmp" --a11y-dump "check/$1.txt" </dev/null
|
|
done
|
|
for e in bmp txt; do
|
|
cmp "check/tree.$e" "check/embedded.$e"
|
|
done
|
|
EOF
|
|
|
|
- name: Upload libreaktor
|
|
if: ${{ !cancelled() && steps.libcheck.outcome == 'success' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: package-libreaktor-linux-${{ matrix.arch }}
|
|
path: |
|
|
dist/libreaktor-*.tar.gz
|
|
!dist/libreaktor-shared-*.tar.gz
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
|
|
- name: Collect the build logs
|
|
if: ${{ always() && steps.debian.outcome == 'success' }}
|
|
run: |
|
|
docker exec -i debian sh -u <<'EOF'
|
|
mkdir -p smoke
|
|
for f in build/CMakeCache.txt build/CMakeFiles/CMakeConfigureLog.yaml; do
|
|
if [ -f "$f" ]; then cp "$f" smoke/; fi
|
|
done
|
|
EOF
|
|
|
|
- name: Upload the shots
|
|
if: ${{ always() && steps.debian.outcome == 'success' }}
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: linux-${{ matrix.arch }}
|
|
path: smoke/
|
|
if-no-files-found: warn
|
|
retention-days: 14
|
|
|
|
linux-emulated:
|
|
name: linux ${{ matrix.arch }}
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: ${{ matrix.timeout }}
|
|
continue-on-error: ${{ matrix.emulated && !inputs.strict }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { arch: armhf, platform: linux/arm/v7, image: 'debian:bookworm', runner: ubuntu-24.04, emulated: true, timeout: 240, triple: arm-linux-gnueabihf, debarch: armhf }
|
|
- { arch: riscv64, platform: linux/riscv64, image: 'debian:trixie', runner: ubuntu-24.04, emulated: true, timeout: 240, triple: riscv64-linux-gnu, debarch: riscv64 }
|
|
|
|
steps: *linux-steps
|
|
|
|
rpm:
|
|
name: linux rpm ${{ matrix.arch }}
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { arch: x86-64, runner: ubuntu-24.04 }
|
|
- { arch: arm64, runner: ubuntu-24.04-arm }
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
|
|
- name: Build, pack and install libreaktor as an rpm
|
|
run: |
|
|
docker run --rm -i -v "$PWD:/src" -w /src fedora:latest sh -eu <<'EOF'
|
|
dnf install -y cmake ninja-build gcc gcc-c++ pkgconf rpm-build \
|
|
libX11-devel libXext-devel libXcursor-devel libXi-devel libXfixes-devel \
|
|
libXrandr-devel libXrender-devel libXtst-devel libxkbcommon-devel \
|
|
wayland-devel wayland-protocols-devel libglvnd-devel dbus-devel </dev/null
|
|
sh tools/libreaktor-pkg.sh -i -o dist-pkg </dev/null
|
|
rpm -q libreaktor
|
|
cmake -S examples/consumer -B build-pkg-consumer -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_PREFIX_PATH=/opt/reaktor </dev/null
|
|
cmake --build build-pkg-consumer </dev/null
|
|
rpm -e libreaktor
|
|
rm -rf build-pkg
|
|
sh tools/libreaktor-pkg.sh -s -i -o dist-pkg-shared </dev/null
|
|
rpm -q libreaktor1 libreaktor-sdl3-0 libreaktor-shared
|
|
cmake -S examples/consumer -B build-pkg-shared -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_PREFIX_PATH=/opt/reaktor -DCONSUMER_SHARED=ON </dev/null
|
|
cmake --build build-pkg-shared </dev/null
|
|
rpm -e libreaktor-shared
|
|
build-pkg-shared/simple --theme light --video dummy --shot check-shared.bmp </dev/null
|
|
mv dist-pkg-shared/*.rpm dist-pkg/
|
|
EOF
|
|
|
|
# One folder: two paths would keep dist-pkg/ and dist-pkg-shared/ in the
|
|
# artifact, and the release expects every package at the top.
|
|
- name: Upload the .rpm
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: package-rpm-linux-${{ matrix.arch }}
|
|
path: dist-pkg/*.rpm
|
|
if-no-files-found: error
|
|
retention-days: 14
|