Take the AppImage's shader compilers from LunarG's Vulkan SDK when Ubuntu's archive does not resolve on the runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-11 11:39:52 -05:00
parent a8fa1a9370
commit bdcf07bbf6

View File

@@ -35,16 +35,29 @@ jobs:
- uses: astral-sh/setup-uv@v6
- name: Shader compilers
# make_appimage.py compiles the runtime's own shaders (tools/build_shaders.py: glslc, spirv-as, spirv-val)
# The runner's sources go through a mirror list whose first host (azure.archive.ubuntu.com) stopped resolving
# on 2026-11-11, and apt then failed every fetch: the sources name Ubuntu's own archive instead.
# On 2026-11-11 the runners could not resolve Ubuntu's archive hosts (azure.archive.ubuntu.com, then
# archive.ubuntu.com) and apt failed every fetch for hours. When they do not resolve, the three tools come from
# LunarG's Vulkan SDK for Linux instead, which holds all of them.
run: |
sudo sed -i 's|mirror+file:/etc/apt/apt-mirrors.txt|http://archive.ubuntu.com/ubuntu/|' \
/etc/apt/sources.list.d/*.sources /etc/apt/sources.list 2>/dev/null || true
for i in 1 2 3; do
if getent hosts azure.archive.ubuntu.com >/dev/null || getent hosts archive.ubuntu.com >/dev/null; then
sudo apt-get update && sudo apt-get install -y glslc spirv-tools && exit 0
echo "apt failed ($i), trying again in 30 s"; sleep 30
echo "::warning::apt failed: the shader compilers come from the Vulkan SDK"
else
echo "::warning::Ubuntu's archive does not resolve: the shader compilers come from the Vulkan SDK"
fi
sdk="$RUNNER_TEMP/vulkan-sdk"
mkdir -p "$sdk"
for f in vulkan-sdk.tar.xz vulkan-sdk.tar.gz; do
curl -fsSL --retry 3 -o "$RUNNER_TEMP/$f" "https://sdk.lunarg.com/sdk/download/latest/linux/$f" &&
tar -xf "$RUNNER_TEMP/$f" -C "$sdk" && break
done
exit 1
bin=$(dirname "$(find "$sdk" -type f -name glslc -path '*/bin/*' | head -1)")
test -x "$bin/glslc" && test -x "$bin/spirv-as" && test -x "$bin/spirv-val"
echo "$bin" >> "$GITHUB_PATH"
if ! "$bin/spirv-as" --version >/dev/null 2>&1; then # the SDK's tools may link its own shared libraries
echo "LD_LIBRARY_PATH=$(cd "$bin/../lib" && pwd)${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
fi
"$bin/glslc" --version | head -1
- name: Shader translator and VMA
run: |
uv venv -q --python 3.12 .venv