Skip to content

Commit e65bedc

Browse files
authored
Update cl shim generation in build-wheel.yml
1 parent 4f29e8f commit e65bedc

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/build-wheel.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,20 @@ jobs:
8989
echo "Found cl.exe at: ${CL_EXE}"
9090
echo "CL_EXE=${CL_EXE}" >> $GITHUB_ENV
9191
92-
- name: Generate sccache wrapper script
92+
- name: Write and compile cl shim (creates cl.exe that calls sccache)
9393
if: ${{ startsWith(inputs.host-platform, 'win') }}
9494
run: |
95-
# Create a wrapper directory
96-
mkdir -p sccache_wrapper
97-
# Generate the wrapper script named cl.exe
98-
CL_EXE=$(cygpath -w "${CL_EXE}")
99-
cat > sccache_wrapper/cl.exe <<'EOF'
100-
@echo off
101-
${{ env.SCCACHE_PATH }} ${CL_EXE} %*
102-
EOF
103-
cat sccache_wrapper/cl.exe
104-
# Record the wrapper path for later use
105-
echo "SCCACHE_WRAPPER_DIR=$(realpath "./sccache_wrapper")" >> $GITHUB_ENV
95+
cl "/nologo" "/O2" ci/tools/cl_shim.c "/Fe:cl.exe"
96+
RC=$?
97+
if [ $RC -ne 0 ]; then
98+
echo "cl failed with exit code $RC" >&2
99+
exit $RC
100+
fi
101+
if [ ! -f ./cl.exe ]; then
102+
echo "Failed to build cl_shim.c: output not found" >&2
103+
exit 1
104+
fi
105+
echo "SCCACHE_WRAPPER_DIR=$(realpath .)" >> $GITHUB_ENV
106106
107107
- name: Set environment variables
108108
env:

0 commit comments

Comments
 (0)