Skip to content

fix: clear bindings dir before adding prior wheel - #2655

Open
andrewwhitecdw wants to merge 2 commits into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/build-wheel-clear-bindings-dir-before-adding-prior
Open

fix: clear bindings dir before adding prior wheel#2655
andrewwhitecdw wants to merge 2 commits into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/build-wheel-clear-bindings-dir-before-adding-prior

Conversation

@andrewwhitecdw

Copy link
Copy Markdown
Contributor

This PR addresses the following issue in .github/workflows/build-wheel.yml: clear bindings dir before adding prior wheel.

Changes

  • .github/workflows/build-wheel.yml: clear bindings dir before adding prior wheel.

Details

--- a/.github/workflows/build-wheel.yml
+++ b/.github/workflows/build-wheel.yml
@@ -1,15 +1,17 @@
-          OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
-          OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
-          LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI")
-          PREV_BINDINGS_DIR="cuda_bindings/dist-prev"
-
-          gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python
-          rm -rf ${OLD_BASENAME}-tests  # exclude cython test artifacts
-          ls -al $OLD_BASENAME
-          mkdir -p "${PREV_BINDINGS_DIR}"
-          mv $OLD_BASENAME/*.whl "${PREV_BINDINGS_DIR}"
-          rmdir $OLD_BASENAME
-...
-      - name: Constrain previous cuda.core to the downloaded cuda.bindings wheel
-        ...
-          bindings_wheels=(cuda_bindings/dist-prev/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl)
+          OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
+          OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
+          LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI")
+          PREV_BINDINGS_DIR="${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
+
+          gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python
+          rm -rf ${OLD_BASENAME}-tests  # exclude cython test artifacts
+          ls -al $OLD_BASENAME
+          mkdir -p "${PREV_BINDINGS_DIR}"
+          # Clear any current-CUDA wheel so only the prior wheel is staged.
+          rm -f "${PREV_BINDINGS_DIR}"/*.whl
+          mv $OLD_BASENAME/*.whl "${PREV_BINDINGS_DIR}"
+          rmdir $OLD_BASENAME
+...
+      - name: Constrain previous cuda.core to the downloaded cuda.bindings wheel
+        ...
+          bindings_wheels=("${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl)

Tests

  • .github/workflows/build-wheel.yml
--- .github/workflows/build-wheel.yml
+++ .github/workflows/build-wheel.yml
@@ -540,6 +540,17 @@
             printf 'cuda-bindings @ %s\n' "${bindings_uri}"
           } | tee wheel-constraints/cuda-core-prev.txt
 
+      - name: Verify prior cuda.bindings staging
+        if: ${{ inputs.build-core }}
+        run: |
+          # Ensure the staging directory contains exactly one wheel so pip cannot
+          # accidentally resolve a different cuda.bindings version.
+          shopt -s nullglob
+          whl_files=("${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/*.whl)
+          shopt -u nullglob
+          if [[ "${#whl_files[@]}" -ne 1 ]]; then
+            echo "Expected exactly one wheel in ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}, found ${#whl_files[@]}:"
+            ls -la "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
+            exit 1
+          fi
+
       - name: Build cuda.core wheel

Contributor guidelines

Per this repo's CONTRIBUTING.md:

  • All commits are signed off (Signed-off-by trailer, DCO).

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI/CD CI/CD infrastructure label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant