Skip to content

Commit 3f320ab

Browse files
authored
clean up and apply sccache to cuda.core builds too
1 parent 6641a88 commit 3f320ab

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

.github/workflows/build-wheel.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ jobs:
8787
exit 1
8888
fi
8989
echo "Found cl.exe at: ${CL_EXE}"
90+
91+
# This env var is passed to cibuildwheel later
9092
echo "CL_EXE=${CL_EXE}" >> $GITHUB_ENV
9193
92-
- name: Write and compile cl shim (creates cl.exe that calls sccache)
94+
# Make the shim executable from the next step discoverable
95+
echo "SCCACHE_WRAPPER_DIR=$(realpath .)" >> $GITHUB_ENV
96+
97+
- name: Compile a shim cl.exe
9398
if: ${{ startsWith(inputs.host-platform, 'win') }}
9499
shell: pwsh
95100
run: |
@@ -105,11 +110,6 @@ jobs:
105110
}
106111
ls
107112
108-
- name: debug
109-
if: ${{ startsWith(inputs.host-platform, 'win') }}
110-
run: |
111-
echo "SCCACHE_WRAPPER_DIR=$(realpath .)" >> $GITHUB_ENV
112-
113113
- name: Set environment variables
114114
env:
115115
CUDA_VER: ${{ inputs.cuda-version }}
@@ -186,8 +186,6 @@ jobs:
186186
ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }}
187187
SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }}
188188
SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }}
189-
CIBW_BEFORE_ALL_WINDOWS: >
190-
echo %PATH%
191189
CIBW_ENVIRONMENT_WINDOWS: >
192190
CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
193191
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
@@ -199,7 +197,6 @@ jobs:
199197
ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }}
200198
SCCACHE_DIR="$(cygpath -w ${{ env.SCCACHE_DIR }})"
201199
SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }}
202-
SCCACHE_LOG=debug
203200
DISTUTILS_USE_SDK=1
204201
PATH="$(cygpath -w ${{ env.SCCACHE_WRAPPER_DIR }});$PATH"
205202
CL_EXE="$(cygpath -w "${{ env.CL_EXE }}")"
@@ -263,9 +260,22 @@ jobs:
263260
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
264261
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }}
265262
PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})"
263+
SCCACHE_GHA_ENABLED=true
264+
ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
265+
ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }}
266+
ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }}
267+
ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
268+
ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }}
269+
SCCACHE_DIR="$(cygpath -w ${{ env.SCCACHE_DIR }})"
270+
SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }}
271+
DISTUTILS_USE_SDK=1
272+
PATH="$(cygpath -w ${{ env.SCCACHE_WRAPPER_DIR }});$PATH"
273+
CL_EXE="$(cygpath -w "${{ env.CL_EXE }}")"
266274
# check cache stats before leaving cibuildwheel
267275
CIBW_BEFORE_TEST_LINUX: >
268-
"/host${{ env.SCCACHE_PATH }}" --show-stats
276+
"/host/${{ env.SCCACHE_PATH }}" --show-stats
277+
CIBW_BEFORE_TEST_WINDOWS: >
278+
"${{ env.SCCACHE_PATH }}" --show-stats
269279
# force the test stage to be run (so that before-test is not skipped)
270280
# TODO: we might want to think twice on adding this, it does a lot of
271281
# things before reaching this command.
@@ -444,9 +454,22 @@ jobs:
444454
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
445455
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }}
446456
PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})"
457+
SCCACHE_GHA_ENABLED=true
458+
ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
459+
ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }}
460+
ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }}
461+
ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
462+
ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }}
463+
SCCACHE_DIR="$(cygpath -w ${{ env.SCCACHE_DIR }})"
464+
SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }}
465+
DISTUTILS_USE_SDK=1
466+
PATH="$(cygpath -w ${{ env.SCCACHE_WRAPPER_DIR }});$PATH"
467+
CL_EXE="$(cygpath -w "${{ env.CL_EXE }}")"
447468
# check cache stats before leaving cibuildwheel
448469
CIBW_BEFORE_TEST_LINUX: >
449-
"/host${{ env.SCCACHE_PATH }}" --show-stats
470+
"/host/${{ env.SCCACHE_PATH }}" --show-stats
471+
CIBW_BEFORE_TEST_WINDOWS: >
472+
"${{ env.SCCACHE_PATH }}" --show-stats
450473
# force the test stage to be run (so that before-test is not skipped)
451474
# TODO: we might want to think twice on adding this, it does a lot of
452475
# things before reaching this command.

0 commit comments

Comments
 (0)