|
76 | 76 | if: ${{ startsWith(inputs.host-platform, 'win') }} |
77 | 77 | uses: ilammy/msvc-dev-cmd@v1 # TODO: ask admin to allow pinning commits |
78 | 78 |
|
| 79 | + # at this point, cl.exe already exists in PATH |
| 80 | + - name: Find cl.exe and set CL_EXE environment variable |
| 81 | + if: ${{ startsWith(inputs.host-platform, 'win') }} |
| 82 | + run: | |
| 83 | + # Find the full path of cl.exe |
| 84 | + CL_EXE=$(which cl.exe) |
| 85 | + if [ -z "${CL_EXE}" ]; then |
| 86 | + echo "Error: cl.exe not found in PATH" |
| 87 | + exit 1 |
| 88 | + fi |
| 89 | + echo "Found cl.exe at: ${CL_EXE}" |
| 90 | + echo "CL_EXE=$(cygpath -w "${CL_EXE}")" >> $GITHUB_ENV |
| 91 | +
|
| 92 | + - name: Generate sccache wrapper script |
| 93 | + if: ${{ startsWith(inputs.host-platform, 'win') }} |
| 94 | + run: | |
| 95 | + # Create a wrapper directory |
| 96 | + mkdir -p sccache_wrapper |
| 97 | + # Generate the wrapper script named cl.exe |
| 98 | + cat > sccache_wrapper/cl.exe <<'EOF' |
| 99 | + @echo off |
| 100 | + sccache "%CL_EXE%" %* |
| 101 | + EOF |
| 102 | + cat sccache_wrapper/cl.exe |
| 103 | + # Record the wrapper path for later use |
| 104 | + echo "SCCACHE_WRAPPER_DIR=$(realpath "./sccache_wrapper")" >> $GITHUB_ENV |
| 105 | +
|
79 | 106 | - name: Set environment variables |
80 | 107 | env: |
81 | 108 | CUDA_VER: ${{ inputs.cuda-version }} |
@@ -155,9 +182,22 @@ jobs: |
155 | 182 | CIBW_ENVIRONMENT_WINDOWS: > |
156 | 183 | CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" |
157 | 184 | CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} |
| 185 | + SCCACHE_GHA_ENABLED=true |
| 186 | + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} |
| 187 | + ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} |
| 188 | + ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} |
| 189 | + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} |
| 190 | + ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} |
| 191 | + SCCACHE_DIR="$(cygpath -w ${{ env.SCCACHE_DIR }})" |
| 192 | + SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} |
| 193 | + SCCACHE_LOG=debug |
| 194 | + DISTUTILS_USE_SDK=1 |
| 195 | + PATH="$(cygpath -w "${{ env.SCCACHE_WRAPPER_DIR }}");$(dirname "${{ env.SCCACHE_PATH }}");$PATH" |
158 | 196 | # check cache stats before leaving cibuildwheel |
159 | 197 | CIBW_BEFORE_TEST_LINUX: > |
160 | 198 | "/host/${{ env.SCCACHE_PATH }}" --show-stats |
| 199 | + CIBW_BEFORE_TEST_WINDOWS: > |
| 200 | + "${{ env.SCCACHE_PATH }}" --show-stats |
161 | 201 | # force the test stage to be run (so that before-test is not skipped) |
162 | 202 | # TODO: we might want to think twice on adding this, it does a lot of |
163 | 203 | # things before reaching this command. |
|
0 commit comments