Skip to content

Commit f6d85be

Browse files
committed
Refine Linux CI workflow: add spirv-tools as a system fallback for slangc, enhance Vulkan SDK shared library handling, and improve environment diagnostics.
1 parent ba1cbd7 commit f6d85be

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/simple_engine_ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ jobs:
9696
run: |
9797
set -euo pipefail
9898
sudo apt-get update
99-
sudo apt-get install -y curl ca-certificates xz-utils
99+
# `spirv-opt` is required by `slangc` for SPIR-V downstream optimization on Linux.
100+
# Prefer the SDK-provided tools when present, but install a system fallback to make CI robust.
101+
sudo apt-get install -y curl ca-certificates xz-utils spirv-tools
100102
101103
echo "Downloading Vulkan SDK from LunarG..."
102104
# Use the official LunarG download endpoint (latest Linux tarball).
@@ -169,6 +171,17 @@ jobs:
169171
echo "SLANGC_EXECUTABLE=$(command -v slangc)" >> "$GITHUB_ENV"
170172
fi
171173
174+
# Ensure SDK-shipped shared libraries (e.g. slang-glslang-*) can be located at runtime.
175+
# Also provide a small compatibility shim for Slang's attempt to load `pthread`.
176+
compat_dir="${RUNNER_TEMP}/slang-compat"
177+
mkdir -p "$compat_dir"
178+
pthread_path="$(ldconfig -p | awk '/libpthread\.so\.0/{print $NF; exit 0}' || true)"
179+
if [ -n "${pthread_path:-}" ] && [ -f "$pthread_path" ]; then
180+
ln -sf "$pthread_path" "$compat_dir/libpthread.so"
181+
fi
182+
183+
echo "LD_LIBRARY_PATH=$compat_dir:${SDK_SYSROOT}/lib:${VULKAN_SDK_PATH}/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
184+
172185
- name: Vulkan SDK diagnostics (Linux)
173186
if: runner.os == 'Linux'
174187
shell: bash
@@ -179,8 +192,13 @@ jobs:
179192
echo "Vulkan_INCLUDE_DIR=${Vulkan_INCLUDE_DIR:-}"
180193
echo "Vulkan_LIBRARY=${Vulkan_LIBRARY:-}"
181194
echo "SLANGC_EXECUTABLE=${SLANGC_EXECUTABLE:-}"
195+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}"
182196
echo "PATH=$PATH"
183197
echo "which slangc: $(command -v slangc || echo 'NOT FOUND')"
198+
echo "which spirv-opt: $(command -v spirv-opt || echo 'NOT FOUND')"
199+
if command -v spirv-opt >/dev/null 2>&1; then
200+
spirv-opt --version || true
201+
fi
184202
if command -v slangc >/dev/null 2>&1; then
185203
slangc --version || slangc --help || true
186204
fi

0 commit comments

Comments
 (0)