From a2d1f04c58c6f8892ead659e3671f6621b270528 Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 9 Mar 2026 16:52:33 +0200 Subject: [PATCH 1/3] CI: Split debug build into a independent job This also means the bundle isn't being packaged for that build (as I don't think it's important) --- .github/workflows/build-linux.yml | 128 ++++++++++++++++-------------- 1 file changed, 67 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 42cb25d20..d4799065f 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -25,9 +25,6 @@ on: jobs: build-linux: runs-on: ubuntu-latest - concurrency: - group: build-linux-${{ github.ref }} - cancel-in-progress: true steps: - name: Checkout repository uses: actions/checkout@v4 @@ -77,16 +74,6 @@ jobs: export CCACHE_DIR="$CCACHE_DIR" meson setup build_meson --wipe --buildtype=release - - name: Configure Meson (debug) - env: - CC: "ccache clang" - CXX: "ccache clang++" - CCACHE_DIR: ${{ runner.temp }}/ccache - run: | - mkdir -p "$CCACHE_DIR" - export CCACHE_DIR="$CCACHE_DIR" - meson setup build_debug --wipe --buildtype=debug - - name: Build with Ninja env: CC: "ccache clang" @@ -97,15 +84,6 @@ jobs: # Use all available cores for faster parallel builds ninja -C build_meson -j$(nproc) -v - - name: Build Debug with Ninja - env: - CC: "ccache clang" - CXX: "ccache clang++" - CCACHE_DIR: ${{ runner.temp }}/ccache - run: | - export CCACHE_DIR="${{ runner.temp }}/ccache" - ninja -C build_debug -j$(nproc) -v - - name: Install patchelf run: sudo apt-get install -y patchelf @@ -185,47 +163,75 @@ jobs: echo "Bundle ready: $BUNDLE" ls -lh "$BUNDLE" "$BUNDLE/lib" - - name: Bundle debug executable + libraries - env: - GITHUB_SHA: ${{ github.sha }} - run: | - set -euo pipefail - EXE_PATH=build_debug/Minecraft.Client/Minecraft.Client - if [ ! -f "$EXE_PATH" ]; then - echo "ERROR: expected debug executable at $EXE_PATH" >&2 - ls -la build_debug || true - exit 1 - fi - - SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c1-8) - BUNDLE=out/minecraft-client-linux-${SHORT_SHA}-debug - mkdir -p "$BUNDLE/lib" - - # Copy the binary - cp "$EXE_PATH" "$BUNDLE/Minecraft.Client.debug" - - # Collect non-system shared library dependencies and copy them in. - ldd "$EXE_PATH" \ - | awk '/=>/ { print $3 }' \ - | grep -v '^(' \ - | grep -Ev '/(libc|libm|libdl|libpthread|librt|libgcc_s|libstdc\+\+|ld-linux)[^/]*\.so' \ - | sort -u \ - | while read -r lib; do - [ -f "$lib" ] && cp "$lib" "$BUNDLE/lib/" || true - done - - # Patch the binary RPATH so it finds libs in ./lib at runtime - patchelf --set-rpath '$ORIGIN/lib' "$BUNDLE/Minecraft.Client.debug" - - # Keep a copy of the unstripped debug binary (symbols are already present in debug build) - echo "Debug bundle ready: $BUNDLE" - ls -lh "$BUNDLE" "$BUNDLE/lib" - - name: Upload artifact uses: actions/upload-artifact@v4 with: name: minecraft-client-linux-${{ github.sha }} - path: | - out/minecraft-client-linux-*/ - out/minecraft-client-linux-*-debug/ + path: out/minecraft-client-linux-*/ + retention-days: 7 + build-linux-debug: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential python3 python3-pip python3-setuptools libgl1-mesa-dev libglu1-mesa-dev libglfw3-dev libpng-dev pkg-config clang lld ccache libssl-dev + # Set a reasonable ccache size + ccache -M 5G || true + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Cache pip packages + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/build-linux.yml') }} + + - name: Install Meson and Ninja (pip) + run: | + python -m pip install --upgrade pip + pip install meson ninja + + - name: Restore ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache-debug-${{ hashFiles('**/meson.build') }} + + - name: Restore meson cache + uses: actions/cache@v4 + with: + path: ~/.cache/meson + key: ${{ runner.os }}-meson-debug-${{ hashFiles('**/meson.build') }} + + - name: Configure Meson (debug) + env: + CC: "ccache clang" + CXX: "ccache clang++" + CCACHE_DIR: ${{ runner.temp }}/ccache + run: | + mkdir -p "$CCACHE_DIR" + export CCACHE_DIR="$CCACHE_DIR" + meson setup build_debug --wipe --buildtype=debug + + - name: Build Debug with Ninja + env: + CC: "ccache clang" + CXX: "ccache clang++" + CCACHE_DIR: ${{ runner.temp }}/ccache + run: | + export CCACHE_DIR="${{ runner.temp }}/ccache" + ninja -C build_debug -j$(nproc) -v + + - name: Upload debug executable + uses: actions/upload-artifact@v4 + with: + name: minecraft-client-linux-debug_exe-${{ github.sha }} + path: build_debug/Minecraft.Client/Minecraft.Client retention-days: 7 From 4eaf02bfd086efa5a1f79413dcfe18fa46e9c91d Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 9 Mar 2026 17:16:35 +0200 Subject: [PATCH 2/3] CI: Compile the client directly with Meson I'm not sure why Ninja had to be called here --- .github/workflows/build-linux.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index d4799065f..1a3896803 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -74,7 +74,7 @@ jobs: export CCACHE_DIR="$CCACHE_DIR" meson setup build_meson --wipe --buildtype=release - - name: Build with Ninja + - name: Build with Meson env: CC: "ccache clang" CXX: "ccache clang++" @@ -82,7 +82,7 @@ jobs: run: | export CCACHE_DIR="${{ runner.temp }}/ccache" # Use all available cores for faster parallel builds - ninja -C build_meson -j$(nproc) -v + meson compile -C build_meson -j $(nproc) -v Minecraft.Client - name: Install patchelf run: sudo apt-get install -y patchelf @@ -220,14 +220,15 @@ jobs: export CCACHE_DIR="$CCACHE_DIR" meson setup build_debug --wipe --buildtype=debug - - name: Build Debug with Ninja + - name: Build Debug with Meson env: CC: "ccache clang" CXX: "ccache clang++" CCACHE_DIR: ${{ runner.temp }}/ccache run: | export CCACHE_DIR="${{ runner.temp }}/ccache" - ninja -C build_debug -j$(nproc) -v + # Use all available cores for faster parallel builds + meson compile -C build_debug -j $(nproc) -v Minecraft.Client - name: Upload debug executable uses: actions/upload-artifact@v4 From fb39f1afde6c7f1ec531218fa498366a2d50425a Mon Sep 17 00:00:00 2001 From: "Echo J." Date: Mon, 9 Mar 2026 17:29:57 +0200 Subject: [PATCH 3/3] Remove an unused CI file This was effectively replaced by the build-linux.yml script --- .github/workflows/ci.yml | 49 ---------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index bcfa32d7d..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: CI Build - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential pkg-config ca-certificates curl git \ - libgl1-mesa-dev libglu1-mesa-dev libglfw3-dev libpng-dev libx11-dev \ - libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libudev-dev - - - name: Install Meson and Ninja (pip) - run: | - python -m pip install --upgrade pip - pip install meson ninja - - - name: Configure Meson - run: | - meson setup build_meson --wipe --buildtype=release - - - name: Build with Ninja - run: | - ninja -C build_meson -v - - - name: Package build output - run: | - tar -czf minecraft-binaries.tar.gz -C build_meson . - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: minecraft-binaries - path: minecraft-binaries.tar.gz