From 8baa510f7394b3e8e57405cf2687403146b08485 Mon Sep 17 00:00:00 2001 From: lfdevs Date: Thu, 5 Nov 2026 13:00:55 +0800 Subject: [PATCH 1/7] ci: add deepin-crimson job to workflow 'Build Check' --- .github/workflows/build-check.yml | 107 ++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 1a4143ca472..63cd72d6cdb 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -993,3 +993,110 @@ jobs: ~/mesa-for-android-container/*.tar.gz ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + + deepin-crimson: + runs-on: ubuntu-26.04-arm + container: + image: linuxdeepin/deepin:crimson-arm64 + options: --privileged --user root + + steps: + - name: Install dependencies + run: | + echo 'deb-src https://community-packages.deepin.com/deepin/beige/ crimson main commercial community' \ + > /etc/apt/sources.list.d/deepin-src.list + apt update + apt build-dep -y mesa + apt install -y git ccache libxfixes-dev libarchive-dev + + - name: Cache ccache + uses: actions/cache@v5 + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + ccache-${{ runner.os }}-${{ runner.arch }}- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.ccache + ccache --max-size=2G + ccache --show-config + ccache --zero-stats + ccache --show-stats + + - name: Clone repository + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_deepin_crimson_arm64" >> "$GITHUB_ENV" + + - name: Build Mesa + shell: bash + run: | + export CCACHE_DIR=/root/.ccache + echo "Building Mesa..." + cd ~/mesa-for-android-container + meson setup build/ \ + --prefix=/usr \ + -Dplatforms=x11,wayland \ + -Dgallium-drivers=freedreno,zink,virgl,llvmpipe \ + -Dgallium-va=enabled \ + -Dtermux-va-bridge=enabled \ + -Dtermux-va-wayland-shim=enabled \ + -Dvideo-codecs=all \ + -Dgallium-mediafoundation=disabled \ + -Dvulkan-drivers=freedreno \ + -Dvulkan-layers= \ + -Degl=enabled \ + -Dgles2=enabled \ + -Dglvnd=enabled \ + -Dglx=dri \ + -Dlibunwind=disabled \ + -Dintel-rt=disabled \ + -Dmicrosoft-clc=disabled \ + -Dvalgrind=disabled \ + -Dgles1=disabled \ + -Dfreedreno-kmds=kgsl \ + -Dbuildtype=release + ninja -C build/ + echo "Mesa build completed successfully!" + + - name: Save ccache + uses: actions/cache/save@v5 + if: always() + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Package Mesa + shell: bash + run: | + echo "Packaging Mesa..." + cd ~/mesa-for-android-container + mkdir /tmp/mesa-install-tmp + DESTDIR=/tmp/mesa-install-tmp meson install -C build/ + tar -zcvf mesa_${MESA_RELEASE_NAME_SUFFIX}.tar.gz -C /tmp/mesa-install-tmp . + rm -rf /tmp/mesa-install-tmp + echo "Calculating sha256 checksums..." + find . -maxdepth 1 \( -name "*.tar.gz" \) -type f -printf "%P\0" | xargs -0 sha256sum | sort -k2 > sha256sums.txt + cat sha256sums.txt && echo + echo "Packaging completed successfully!" + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-for-android-container/*.tar.gz + ~/mesa-for-android-container/sha256sums.txt + retention-days: 90 From 8e4f9b450fba45d3ddd941657a4ee80f8308eeb5 Mon Sep 17 00:00:00 2001 From: lfdevs Date: Thu, 5 Nov 2026 18:44:58 +0800 Subject: [PATCH 2/7] ci: add aosc job to workflow 'Build Check' --- .github/workflows/build-check.yml | 106 ++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 63cd72d6cdb..34c3c970565 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -1100,3 +1100,109 @@ jobs: ~/mesa-for-android-container/*.tar.gz ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + + aosc: + runs-on: ubuntu-26.04-arm + container: + image: aosc/aosc-os:buildkit + options: --privileged --user root + + steps: + - name: Install dependencies + run: | + export DEBIAN_FRONTEND=noninteractive CI=true + sudo oma refresh + sudo oma upgrade -y + sudo oma install -y x11-lib libdrm expat systemd elfutils nettle libva wayland lm-sensors libglvnd llvm-runtime libcl libclc spirv-llvm-translator libdisplay-info xcb-util-keysyms libconfig x11-proto mako valgrind llvm libunwind glslang spirv-tools ply rustc rust-bindgen pycparser cbindgen pyyaml directx-headers ccache + + - name: Cache ccache + uses: actions/cache@v5 + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + ccache-${{ runner.os }}-${{ runner.arch }}- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.ccache + ccache --max-size=2G + ccache --show-config + ccache --zero-stats + ccache --show-stats + + - name: Clone repository + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_aosc_arm64" >> "$GITHUB_ENV" + + - name: Build Mesa + shell: bash + run: | + export CCACHE_DIR=/root/.ccache + echo "Building Mesa..." + cd ~/mesa-for-android-container + meson setup build/ \ + --prefix=/usr \ + -Dplatforms=x11,wayland \ + -Dgallium-drivers=freedreno,zink,virgl,llvmpipe \ + -Dgallium-va=enabled \ + -Dtermux-va-bridge=enabled \ + -Dtermux-va-wayland-shim=enabled \ + -Dvideo-codecs=all \ + -Dgallium-mediafoundation=disabled \ + -Dvulkan-drivers=freedreno \ + -Dvulkan-layers= \ + -Degl=enabled \ + -Dgles2=enabled \ + -Dglvnd=enabled \ + -Dglx=dri \ + -Dlibunwind=disabled \ + -Dintel-rt=disabled \ + -Dmicrosoft-clc=disabled \ + -Dvalgrind=disabled \ + -Dgles1=disabled \ + -Dfreedreno-kmds=kgsl \ + -Dbuildtype=release + ninja -C build/ + echo "Mesa build completed successfully!" + + - name: Save ccache + uses: actions/cache/save@v5 + if: always() + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Package Mesa + shell: bash + run: | + echo "Packaging Mesa..." + cd ~/mesa-for-android-container + mkdir /tmp/mesa-install-tmp + DESTDIR=/tmp/mesa-install-tmp meson install -C build/ + tar -zcvf mesa_${MESA_RELEASE_NAME_SUFFIX}.tar.gz -C /tmp/mesa-install-tmp . + rm -rf /tmp/mesa-install-tmp + echo "Calculating sha256 checksums..." + find . -maxdepth 1 \( -name "*.tar.gz" \) -type f -printf "%P\0" | xargs -0 sha256sum | sort -k2 > sha256sums.txt + cat sha256sums.txt && echo + echo "Packaging completed successfully!" + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-for-android-container/*.tar.gz + ~/mesa-for-android-container/sha256sums.txt + retention-days: 90 From 796166098ba912054e431a2bae281d1b59fdf43d Mon Sep 17 00:00:00 2001 From: lfdevs Date: Thu, 5 Nov 2026 22:26:30 +0800 Subject: [PATCH 3/7] ci: add debian-testing job to workflow 'Build Check' --- .github/workflows/build-check.yml | 106 ++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 34c3c970565..be410e7a8a9 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -115,6 +115,112 @@ jobs: ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + debian-testing: + runs-on: ubuntu-26.04-arm + container: + image: debian:testing + options: --privileged --user root + + steps: + - name: Install dependencies + run: | + sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/debian.sources + apt update + apt build-dep -y mesa + apt install -y git ccache libxfixes-dev libarchive-dev + + - name: Cache ccache + uses: actions/cache@v5 + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + ccache-${{ runner.os }}-${{ runner.arch }}- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.ccache + ccache --max-size=2G + ccache --show-config + ccache --zero-stats + ccache --show-stats + + - name: Clone repository + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_debian_testing_arm64" >> "$GITHUB_ENV" + + - name: Build Mesa + shell: bash + run: | + export CCACHE_DIR=/root/.ccache + echo "Building Mesa..." + cd ~/mesa-for-android-container + meson setup build/ \ + --prefix=/usr \ + -Dplatforms=x11,wayland \ + -Dgallium-drivers=freedreno,zink,virgl,llvmpipe \ + -Dgallium-va=enabled \ + -Dtermux-va-bridge=enabled \ + -Dtermux-va-wayland-shim=enabled \ + -Dvideo-codecs=all \ + -Dgallium-mediafoundation=disabled \ + -Dvulkan-drivers=freedreno \ + -Dvulkan-layers= \ + -Degl=enabled \ + -Dgles2=enabled \ + -Dglvnd=enabled \ + -Dglx=dri \ + -Dlibunwind=disabled \ + -Dintel-rt=disabled \ + -Dmicrosoft-clc=disabled \ + -Dvalgrind=disabled \ + -Dgles1=disabled \ + -Dfreedreno-kmds=kgsl \ + -Dbuildtype=release + ninja -C build/ + echo "Mesa build completed successfully!" + + - name: Save ccache + uses: actions/cache/save@v5 + if: always() + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Package Mesa + shell: bash + run: | + echo "Packaging Mesa..." + cd ~/mesa-for-android-container + mkdir /tmp/mesa-install-tmp + DESTDIR=/tmp/mesa-install-tmp meson install -C build/ + tar -zcvf mesa_${MESA_RELEASE_NAME_SUFFIX}.tar.gz -C /tmp/mesa-install-tmp . + rm -rf /tmp/mesa-install-tmp + echo "Calculating sha256 checksums..." + find . -maxdepth 1 \( -name "*.tar.gz" \) -type f -printf "%P\0" | xargs -0 sha256sum | sort -k2 > sha256sums.txt + cat sha256sums.txt && echo + echo "Packaging completed successfully!" + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-for-android-container/*.tar.gz + ~/mesa-for-android-container/sha256sums.txt + retention-days: 90 + ubuntu-noble: runs-on: ubuntu-24.04-arm From ef51e854909cf908a8dd18c4a1924ab795482d2b Mon Sep 17 00:00:00 2001 From: lfdevs Date: Thu, 5 Nov 2026 22:29:09 +0800 Subject: [PATCH 4/7] ci: add ubuntu-rolling job to workflow 'Build Check' --- .github/workflows/build-check.yml | 110 ++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index be410e7a8a9..497c5e453e5 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -541,6 +541,116 @@ jobs: ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + ubuntu-rolling: + runs-on: ubuntu-26.04-arm + container: + image: ubuntu:rolling + options: --privileged --user root + + steps: + - name: Install dependencies + run: | + sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources + apt update + apt build-dep -y mesa + apt install -y git ccache libxfixes-dev libarchive-dev + + - name: Cache ccache + uses: actions/cache@v5 + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + ccache-${{ runner.os }}-${{ runner.arch }}- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.ccache + ccache --max-size=2G + ccache --show-config + ccache --zero-stats + ccache --show-stats + + - name: Clone repository + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_ubuntu_rolling_arm64" >> "$GITHUB_ENV" + + - name: Build Mesa + shell: bash + run: | + export CCACHE_DIR=/root/.ccache + LLVM_CONFIG="$(find /usr/lib -maxdepth 3 -path '/usr/lib/llvm-*/bin/llvm-config' -type f | sort -V | tail -n 1)" + test -n "$LLVM_CONFIG" && test -x "$LLVM_CONFIG" + export LLVM_CONFIG + echo "Using LLVM_CONFIG=$LLVM_CONFIG" + echo "Building Mesa..." + cd ~/mesa-for-android-container + meson setup build/ \ + --prefix=/usr \ + -Dplatforms=x11,wayland \ + -Dgallium-drivers=freedreno,zink,virgl,llvmpipe \ + -Dgallium-va=enabled \ + -Dtermux-va-bridge=enabled \ + -Dtermux-va-wayland-shim=enabled \ + -Dvideo-codecs=all \ + -Dgallium-mediafoundation=disabled \ + -Dvulkan-drivers=freedreno \ + -Dvulkan-layers= \ + -Degl=enabled \ + -Dgles2=enabled \ + -Dglvnd=enabled \ + -Dglx=dri \ + -Dlibunwind=disabled \ + -Dintel-rt=disabled \ + -Dmicrosoft-clc=disabled \ + -Dvalgrind=disabled \ + -Dgles1=disabled \ + -Dfreedreno-kmds=kgsl \ + -Dbuildtype=release + ninja -C build/ + echo "Mesa build completed successfully!" + + - name: Save ccache + uses: actions/cache/save@v5 + if: always() + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Package Mesa + shell: bash + run: | + echo "Packaging Mesa..." + cd ~/mesa-for-android-container + mkdir /tmp/mesa-install-tmp + DESTDIR=/tmp/mesa-install-tmp meson install -C build/ + tar -zcvf mesa_${MESA_RELEASE_NAME_SUFFIX}.tar.gz -C /tmp/mesa-install-tmp . + rm -rf /tmp/mesa-install-tmp + echo "Calculating sha256 checksums..." + find . -maxdepth 1 \( -name "*.tar.gz" \) -type f -printf "%P\0" | xargs -0 sha256sum | sort -k2 > sha256sums.txt + cat sha256sums.txt && echo + echo "Packaging completed successfully!" + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-for-android-container/*.tar.gz + ~/mesa-for-android-container/sha256sums.txt + retention-days: 90 + archlinux: runs-on: ubuntu-24.04-arm container: From 87737cd54315d5ed8874634277d5e03ba492cdc5 Mon Sep 17 00:00:00 2001 From: lfdevs Date: Thu, 5 Nov 2026 22:33:32 +0800 Subject: [PATCH 5/7] ci: add fedora-45 job to workflow 'Build Check' --- .github/workflows/build-check.yml | 107 ++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 497c5e453e5..859cd6e38a7 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -987,6 +987,113 @@ jobs: ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + fedora-45: + runs-on: ubuntu-26.04-arm + container: + image: fedora:45 + options: --privileged --user root + + steps: + - name: Install dependencies + run: | + echo "assumeyes=True" >> /etc/dnf/dnf.conf + dnf install -y dnf-plugins-core git ccache libarchive-devel + dnf config-manager setopt fedora-source.enabled=1 updates-source.enabled=1 + dnf makecache + dnf builddep -y mesa + + - name: Cache ccache + uses: actions/cache@v5 + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + ccache-${{ runner.os }}-${{ runner.arch }}- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.ccache + ccache --max-size=2G + ccache --show-config + ccache --zero-stats + ccache --show-stats + + - name: Clone repository + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_fedora_45_arm64" >> "$GITHUB_ENV" + + - name: Build Mesa + shell: bash + run: | + export CCACHE_DIR=/root/.ccache + echo "Building Mesa..." + cd ~/mesa-for-android-container + meson setup build/ \ + --prefix=/usr \ + -Dplatforms=x11,wayland \ + -Dgallium-drivers=freedreno,zink,virgl,llvmpipe \ + -Dgallium-va=enabled \ + -Dtermux-va-bridge=enabled \ + -Dtermux-va-wayland-shim=enabled \ + -Dvideo-codecs=all \ + -Dgallium-mediafoundation=disabled \ + -Dvulkan-drivers=freedreno \ + -Dvulkan-layers= \ + -Degl=enabled \ + -Dgles2=enabled \ + -Dglvnd=enabled \ + -Dglx=dri \ + -Dlibunwind=disabled \ + -Dintel-rt=disabled \ + -Dmicrosoft-clc=disabled \ + -Dvalgrind=disabled \ + -Dgles1=disabled \ + -Dfreedreno-kmds=kgsl \ + -Dbuildtype=release + ninja -C build/ + echo "Mesa build completed successfully!" + + - name: Save ccache + uses: actions/cache/save@v5 + if: always() + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Package Mesa + shell: bash + run: | + echo "Packaging Mesa..." + cd ~/mesa-for-android-container + mkdir /tmp/mesa-install-tmp + DESTDIR=/tmp/mesa-install-tmp meson install -C build/ + tar -zcvf mesa_${MESA_RELEASE_NAME_SUFFIX}.tar.gz -C /tmp/mesa-install-tmp . + rm -rf /tmp/mesa-install-tmp + echo "Calculating sha256 checksums..." + find . -maxdepth 1 \( -name "*.tar.gz" \) -type f -printf "%P\0" | xargs -0 sha256sum | sort -k2 > sha256sums.txt + cat sha256sums.txt && echo + echo "Packaging completed successfully!" + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-for-android-container/*.tar.gz + ~/mesa-for-android-container/sha256sums.txt + retention-days: 90 + void-linux: runs-on: ubuntu-24.04-arm container: From 998457bbae61c6e88b4509f02f2c1a7b4fb9485a Mon Sep 17 00:00:00 2001 From: lfdevs Date: Thu, 5 Nov 2026 22:51:07 +0800 Subject: [PATCH 6/7] ci: add opensuse-tumbleweed job to workflow 'Build Check' --- .github/workflows/build-check.yml | 109 ++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 859cd6e38a7..edf41da1ea2 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -1317,6 +1317,115 @@ jobs: ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + opensuse-tumbleweed: + runs-on: ubuntu-26.04-arm + container: + image: opensuse/tumbleweed:latest + options: --privileged --user root + + steps: + - name: Install dependencies + run: | + zypper modifyrepo -e repo-source + zypper --non-interactive refresh + zypper --non-interactive install --auto-agree-with-licenses gcc gcc-c++ git ccache llvm-devel libarchive-devel python3 tar gzip findutils + PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}{sys.version_info.minor}")') + zypper --non-interactive install "python${PYTHON_VERSION}-packaging" + zypper --non-interactive source-install --build-deps-only Mesa + + - name: Cache ccache + uses: actions/cache@v5 + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + ccache-${{ runner.os }}-${{ runner.arch }}- + + - name: Configure ccache + run: | + export CCACHE_DIR=/root/.ccache + ccache --max-size=2G + ccache --show-config + ccache --zero-stats + ccache --show-stats + + - name: Clone repository + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_opensuse_tumbleweed_arm64" >> "$GITHUB_ENV" + + - name: Build Mesa + shell: bash + run: | + export CCACHE_DIR=/root/.ccache + echo "Building Mesa..." + cd ~/mesa-for-android-container + meson setup build/ \ + --prefix=/usr \ + --libdir=lib64 \ + -Dplatforms=x11,wayland \ + -Dgallium-drivers=freedreno,zink,virgl,llvmpipe \ + -Dgallium-va=enabled \ + -Dtermux-va-bridge=enabled \ + -Dtermux-va-wayland-shim=enabled \ + -Dvideo-codecs=all \ + -Dgallium-mediafoundation=disabled \ + -Dvulkan-drivers=freedreno \ + -Dvulkan-layers= \ + -Degl=enabled \ + -Dgles2=enabled \ + -Dglvnd=enabled \ + -Dglx=dri \ + -Dlibunwind=disabled \ + -Dintel-rt=disabled \ + -Dmicrosoft-clc=disabled \ + -Dvalgrind=disabled \ + -Dgles1=disabled \ + -Dfreedreno-kmds=kgsl \ + -Dbuildtype=release + ninja -C build/ + echo "Mesa build completed successfully!" + + - name: Save ccache + uses: actions/cache/save@v5 + if: always() + with: + path: /root/.ccache + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Package Mesa + shell: bash + run: | + echo "Packaging Mesa..." + cd ~/mesa-for-android-container + mkdir /tmp/mesa-install-tmp + DESTDIR=/tmp/mesa-install-tmp meson install -C build/ + tar -zcvf mesa_${MESA_RELEASE_NAME_SUFFIX}.tar.gz -C /tmp/mesa-install-tmp . + rm -rf /tmp/mesa-install-tmp + echo "Calculating sha256 checksums..." + find . -maxdepth 1 \( -name "*.tar.gz" \) -type f -printf "%P\0" | xargs -0 sha256sum | sort -k2 > sha256sums.txt + cat sha256sums.txt && echo + echo "Packaging completed successfully!" + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-for-android-container/*.tar.gz + ~/mesa-for-android-container/sha256sums.txt + retention-days: 90 + deepin-crimson: runs-on: ubuntu-26.04-arm container: From 0734538c6c56b00648dbdc094f98f1f4bf76255d Mon Sep 17 00:00:00 2001 From: lfdevs Date: Fri, 6 Nov 2026 18:41:19 +0800 Subject: [PATCH 7/7] ci: add nixos job to workflow 'Build Check' --- .github/workflows/build-check.yml | 224 ++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index edf41da1ea2..d81032b651b 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -1638,3 +1638,227 @@ jobs: ~/mesa-for-android-container/*.tar.gz ~/mesa-for-android-container/sha256sums.txt retention-days: 90 + + nixos: + runs-on: ubuntu-26.04-arm + + steps: + - name: Clone repositories + run: | + cd ~ + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone -b ${{ github.event.pull_request.head.ref }} --depth 1 ${{ github.event.pull_request.head.repo.html_url }}.git mesa-for-android-container + git clone --branch nixos-26.05 --depth 1 https://github.com/NixOS/nixpkgs.git nixpkgs + + - name: Set release name suffix + shell: bash + run: | + cd ~/mesa-for-android-container + version=$(grep -v '^[[:space:]]*$' VERSION | head -n1) + short_hash=$(git rev-parse --short HEAD) + echo "MESA_RELEASE_NAME_SUFFIX=${version}-${short_hash}_nixos_arm64" >> "$GITHUB_ENV" + + - name: Configure nixpkgs Mesa + shell: bash + run: | + export MESA_VERSION="${MESA_RELEASE_NAME_SUFFIX%_nixos_arm64}" + python3 <<'PY' + import os + from pathlib import Path + import re + + mesa = Path.home() / "nixpkgs/pkgs/development/libraries/mesa" + + def replace(text, pattern, replacement): + text, count = re.subn(pattern, lambda _: replacement, text, count=1, flags=re.S) + if count != 1: + raise RuntimeError(f"Mesa recipe no longer matches: {pattern}") + return text + + common = mesa / "common.nix" + text = common.read_text() + text = replace(text, r' version = ".*?";', f' version = "{os.environ["MESA_VERSION"]}";') + # Use the checkout mounted in the build container, without a fixed-output hash. + text = replace(text, r' src = fetchFromGitLab \{.*?\n \};', + ' src = lib.cleanSource /mesa-for-android-container;') + common.write_text(text) + + recipe = mesa / "default.nix" + text = recipe.read_text() + text = replace(text, r' patches = \[.*?\n \];', ' patches = [];') + # The separate nixpkgs header package tracks a different Mesa release. + text = replace(text, r" postPatch = ''.*?\n '';", " postPatch = ''patchShebangs .'';") + text = replace(text, r' outputs = \[.*?\n \];', ' outputs = [ "out" ];') + text = replace(text, r' mesonFlags = \[', ' mesonBuildType = "release";\n\n mesonFlags = [') + flags = [ + "-Dplatforms=x11,wayland", + "-Dgallium-drivers=freedreno,zink,virgl,llvmpipe", + "-Dgallium-va=enabled", + "-Dtermux-va-bridge=enabled", + "-Dtermux-va-wayland-shim=enabled", + "-Dvideo-codecs=all", + "-Dgallium-mediafoundation=disabled", + "-Dandroid-libbacktrace=disabled", + "-Dvulkan-drivers=freedreno", + "-Dvulkan-layers=", + "-Degl=enabled", + "-Dgles2=enabled", + "-Dglvnd=enabled", + "-Dglx=dri", + "-Dlibunwind=disabled", + "-Dintel-rt=disabled", + "-Dmicrosoft-clc=disabled", + "-Dvalgrind=disabled", + "-Dgles1=disabled", + "-Dfreedreno-kmds=kgsl", + "-Dlibgbm-external=false", + "-Dgallium-rusticl=false", + "-Dteflon=false", + ] + text = replace(text, r' mesonFlags = \[.*?\n \];', + ' mesonFlags = [\n' + ''.join(f' "{flag}"\n' for flag in flags) + ' ];') + text = replace(text, r" postInstall = ''.*?\n '';", " postInstall = '''';") + # Keep Nix store paths in manifests and let Zink find the Vulkan loader. + text = replace(text, r" postFixup = ''.*?\n '';", """ postFixup = '' + for js in $out/share/glvnd/egl_vendor.d/*.json; do + substituteInPlace "$js" --replace-fail '"libEGL_' '"'"$out/lib/libEGL_" + done + patchelf --add-rpath ${vulkan-loader}/lib $out/lib/libgallium*.so + '';""") + recipe.write_text(text) + PY + + - name: Build and export Mesa Nix closure + shell: bash + run: | + mkdir -p ~/mesa-nixos-artifacts + docker run --privileged --rm \ + -v "$HOME/mesa-for-android-container:/mesa-for-android-container:ro" \ + -v "$HOME/nixpkgs:/nixpkgs:ro" \ + -v "$HOME/mesa-nixos-artifacts:/artifacts" \ + -e MESA_RELEASE_NAME_SUFFIX \ + nixos/nix:latest \ + bash -euo pipefail -c ' + nix-build /nixpkgs -A mesa --out-link /artifacts/result + result_path=$(readlink -f /artifacts/result) + echo "$result_path" > /artifacts/result-path.txt + nix-store --query --requisites "$result_path" > /artifacts/closure-paths.txt + mapfile -t closure_paths < /artifacts/closure-paths.txt + nix-store --export "${closure_paths[@]}" | gzip > "/artifacts/mesa_${MESA_RELEASE_NAME_SUFFIX}.nar.gz" + ' + sudo chown -R "$(id -u):$(id -g)" ~/mesa-nixos-artifacts + cat > ~/mesa-nixos-artifacts/install.sh <<'EOF' + #!/usr/bin/env bash + set -euo pipefail + + artifact_dir=$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) + nar_path=$(find "$artifact_dir" -maxdepth 1 -name 'mesa_*.nar.gz' -type f -print -quit) + test -n "$nar_path" + + gzip -dc "$nar_path" | nix-store --import >/dev/null + result_path=$(cat "$artifact_dir/result-path.txt") + case "$result_path" in + /nix/store/*) ;; + *) echo "Invalid Nix store path: $result_path" >&2; exit 1 ;; + esac + + install_method=${MESA_NIX_INSTALL_METHOD:-auto} + install_method_used= + + install_with_nix_profile() { + command -v nix >/dev/null 2>&1 || return 1 + if nix --extra-experimental-features 'nix-command flakes' profile install "$result_path"; then + install_method_used=nix-profile + return 0 + fi + return 1 + } + + install_with_nix_env() { + command -v nix-env >/dev/null 2>&1 || return 1 + nix-env -i "$result_path" + install_method_used=nix-env + } + + case "$install_method" in + auto) + install_with_nix_profile || install_with_nix_env || { + echo "Neither 'nix profile install' nor 'nix-env -i' succeeded." >&2 + exit 1 + } + ;; + nix-profile|profile) + install_with_nix_profile || { + echo "Requested nix profile installation, but it is unavailable." >&2 + exit 1 + } + ;; + nix-env|env) + install_with_nix_env || { + echo "Requested nix-env installation, but nix-env is unavailable." >&2 + exit 1 + } + ;; + *) + echo "Unknown MESA_NIX_INSTALL_METHOD: $install_method" >&2 + echo "Use auto, nix-profile, or nix-env." >&2 + exit 1 + ;; + esac + + echo "Installed $result_path with $install_method_used." + + if [ "${MESA_NIXOS_SWITCH:-1}" = 0 ]; then + echo "NixOS system driver switch disabled by MESA_NIXOS_SWITCH=0." + exit 0 + fi + + if [ ! -e /etc/NIXOS ] && [ ! -d /etc/nixos ]; then + echo "NixOS not detected; leaving the installed profile unchanged." + exit 0 + fi + + nixos_rebuild=$(command -v nixos-rebuild || true) + if [ -z "$nixos_rebuild" ]; then + echo "NixOS detected, but nixos-rebuild is unavailable." >&2 + exit 1 + fi + if [ ! -f /etc/nixos/configuration.nix ]; then + echo "NixOS detected, but /etc/nixos/configuration.nix is missing." >&2 + exit 1 + fi + + overlay=$(mktemp /tmp/mesa-nixos-configuration.XXXXXX.nix) + trap 'rm -f "$overlay"' EXIT + cat > "$overlay" < sha256sums.txt) + cat ~/mesa-nixos-artifacts/sha256sums.txt + + - name: Upload installable Mesa Nix closure + uses: actions/upload-artifact@v7 + with: + name: mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }} + path: | + ~/mesa-nixos-artifacts/mesa_${{ env.MESA_RELEASE_NAME_SUFFIX }}.tar + ~/mesa-nixos-artifacts/sha256sums.txt + retention-days: 90