From f724ecc09d8bb07f2c0ad1596650c1cb8ad4db5b Mon Sep 17 00:00:00 2001 From: Alexandre Date: Mon, 12 Oct 2026 13:17:05 +0200 Subject: [PATCH] Added debug artefact --- .gitea/workflows/build_linux.yaml | 98 +++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/.gitea/workflows/build_linux.yaml b/.gitea/workflows/build_linux.yaml index b4a472e..735cd2d 100644 --- a/.gitea/workflows/build_linux.yaml +++ b/.gitea/workflows/build_linux.yaml @@ -53,6 +53,104 @@ jobs: # 2. Debian 12 builds: portable (static) and bundle (bin/ + lib/) # Built on glibc 2.36 => runs on Debian 12 and anything newer. # --------------------------------------------------------------------------- + debug: + needs: nix + runs-on: ubuntu-latest + container: debian:12 + strategy: + fail-fast: false + steps: + # git + nodejs must exist before checkout (JS actions run in the container) + - name: Dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends \ + git ca-certificates nodejs curl \ + build-essential cmake ninja-build pkg-config \ + libwayland-dev libwayland-bin wayland-protocols libxkbcommon-dev \ + libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Git safe directory + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Download shaders + uses: actions/download-artifact@v4 + with: + name: shaders + path: prebuilt-shaders + + - name: Configure + run: | + cmake -S . -B build -G Ninja \ + --preset debug \ + -DVULKANENGINE_FETCH_DEPS=ON \ + -DVULKANENGINE_PORTABLE=ON \ + -DVULKANENGINE_PREBUILT_SHADERS="$PWD/prebuilt-shaders" + + - name: Build + run: cmake --build build --parallel 2 + + - name: Install + run: cmake --install build --prefix dist --strip + + - name: Check binaries + shell: bash + run: | + set -euo pipefail + for b in dist/bin/engine dist/bin/server; do + echo "========== $b ==========" + readelf -l "$b" | grep 'program interpreter' + readelf -d "$b" | grep -E 'RPATH|RUNPATH|NEEDED' || true + + if strings "$b" | grep -q '/nix/store'; then + echo "ERROR: $b references /nix/store"; exit 1 + fi + + # The loader must come from volk (dlopen), never from NEEDED + if readelf -d "$b" | grep -q 'libvulkan'; then + echo "ERROR: $b links libvulkan directly"; exit 1 + fi + + if [ "PORTABLE" = "PORTABLE" ]; then + if readelf -d "$b" | grep -Eq 'libstdc\+\+|libgcc_s'; then + echo "ERROR: $b is not static for libstdc++/libgcc"; exit 1 + fi + fi + + max=$(objdump -T "$b" | grep -o 'GLIBC_[0-9.]*' | sed 's/GLIBC_//' | sort -uV | tail -1 || true) + echo "Highest GLIBC symbol: ${max:-none}" + if [ -n "$max" ] && [ "$(printf '%s\n%s\n' "$max" 2.36 | sort -V | tail -1)" != "2.36" ]; then + echo "ERROR: needs glibc $max (> 2.36)"; exit 1 + fi + + if ldd "$b" | grep 'not found'; then + echo "ERROR: unresolved libraries in $b"; exit 1 + fi + done + + # tar keeps permissions and symlinks; artifact zips do not + - name: Package + run: | + tar -C dist -czf VulkanEngine-DEBUG-linux-x86_64.tar.gz . + + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: VulkanEngine-DEBUG-linux-x86_64 + path: VulkanEngine-DEBUG-linux-x86_64.tar.gz + - name: Notify progress + if: failure() + run: | + curl \ + -H "Title: [Routine] Engine-DEBUG build" \ + -d "Build failed (nix: ${{ needs.nix.result }}, release: ${{ needs.debug.result }})" \ + https://ntfy.alexdelcamp.fr/FlakeBuild release: needs: nix runs-on: ubuntu-latest