Skip to content

Commit 78c8872

Browse files
committed
Add fail-fast guards to Falcor copy step; add slang-rt.dll
If a required file is absent the step now exits immediately with a clear error rather than silently copying nothing and letting tests run against the wrong binaries (CodeRabbit review feedback).
1 parent bae3204 commit 78c8872

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/ci-falcor-test.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,28 @@ jobs:
4545
cd ..\
4646
- name: Copy Slang to Falcor
4747
run: |
48+
set -euo pipefail
4849
TARGET="./FalcorBin/build/windows-vs2022/bin/Release"
4950
SRC="slang-bin/Release/bin"
5051
# Copy only Slang core DLLs and executables — the full CI artifact also
5152
# contains gfx.dll, platform.dll, dawn.dll, and test-tool DLLs that
5253
# Falcor provides its own versions of; overwriting those breaks FalcorTest.
54+
# slang-rt.dll must be copied alongside slang.dll: it is a version-matched
55+
# runtime peer, and leaving C:\Falcor's older copy in place while replacing
56+
# slang.dll causes FalcorTest.exe to crash during DLL initialization.
5357
for name in slang.dll slang-rt.dll slang-compiler.dll slang-llvm.dll slang-glslang.dll slang-glsl-module.dll dxcompiler.dll dxil.dll slangc.exe; do
54-
[ -f "$SRC/$name" ] && cp --verbose "$SRC/$name" "$TARGET/"
58+
[[ -f "$SRC/$name" ]] || { echo "Missing required file: $SRC/$name" >&2; exit 1; }
59+
cp --verbose "$SRC/$name" "$TARGET/"
5560
done
5661
for d in D3D12 optix; do
57-
[ -d "$SRC/$d" ] && cp --verbose -r "$SRC/$d" "$TARGET/"
62+
[[ -d "$SRC/$d" ]] || { echo "Missing required directory: $SRC/$d" >&2; exit 1; }
63+
cp --verbose -r "$SRC/$d" "$TARGET/"
5864
done
59-
for d in "$SRC"/slang-standard-module-*/; do
60-
[ -d "$d" ] && cp --verbose -r "$d" "$TARGET/"
65+
shopt -s nullglob
66+
modules=( "$SRC"/slang-standard-module-*/ )
67+
(( ${#modules[@]} > 0 )) || { echo "Missing slang-standard-module-* in $SRC" >&2; exit 1; }
68+
for d in "${modules[@]}"; do
69+
cp --verbose -r "$d" "$TARGET/"
6170
done
6271
- name: falcor-unit-test
6372
shell: pwsh

0 commit comments

Comments
 (0)