From 781238aa87a84f56b553b47c86de5c4605db8cec Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 14 Apr 2026 14:21:49 -0400 Subject: [PATCH 1/4] CI: Test sdist builds for all user-facing packages Add a new test-sdist workflow that builds an sdist and then a wheel-from-sdist for each of the 4 user-facing packages (cuda_pathfinder, cuda_python, cuda_bindings, cuda_core). This catches regressions in MANIFEST.in or package-data configuration that could silently break sdist-based builds. Closes #1599 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 16 +++++ .github/workflows/test-sdist.yml | 105 +++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 .github/workflows/test-sdist.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f575d2f851..aeb9dc3f17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -286,6 +286,18 @@ jobs: cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} + test-sdist: + needs: + - ci-vars + - should-skip + name: Test sdist + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }} + secrets: inherit + uses: ./.github/workflows/test-sdist.yml + with: + host-platform: linux-64 + cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + # NOTE: Test jobs are split by platform for the same reason as build jobs (see # build-linux-64). Keep these job definitions textually identical except for: # - host-platform value @@ -388,6 +400,7 @@ jobs: needs: - should-skip - detect-changes + - test-sdist - test-linux-64 - test-linux-aarch64 - test-windows @@ -427,6 +440,9 @@ jobs: if ${{ needs.doc.result == 'cancelled' || needs.doc.result == 'failure' }}; then exit 1 fi + if ${{ needs.test-sdist.result == 'cancelled' || needs.test-sdist.result == 'failure' }}; then + exit 1 + fi if [[ "${doc_only}" != "true" ]]; then if ${{ needs.test-linux-64.result == 'cancelled' || needs.test-linux-64.result == 'failure' || diff --git a/.github/workflows/test-sdist.yml b/.github/workflows/test-sdist.yml new file mode 100644 index 0000000000..845e3438c9 --- /dev/null +++ b/.github/workflows/test-sdist.yml @@ -0,0 +1,105 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +on: + workflow_call: + inputs: + host-platform: + required: true + type: string + cuda-version: + required: true + type: string + +defaults: + run: + shell: bash --noprofile --norc -xeuo pipefail {0} + +permissions: + contents: read # This is required for actions/checkout + +jobs: + test-sdist: + name: Test sdist builds + runs-on: linux-amd64-cpu8 + steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: "3.12" + + - name: Install build tools + run: pip install build + + # Pure Python packages -- no CTK needed. + - name: Build cuda.pathfinder sdist and wheel-from-sdist + run: | + python -m build --sdist cuda_pathfinder/ + pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz + + - name: Build cuda-python sdist and wheel-from-sdist + run: | + python -m build --sdist cuda_python/ + pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz + + # Cython packages need CTK + sccache. + # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN + # are exposed by this action. + - name: Enable sccache + uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 + with: + disable_annotations: 'true' + + # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 + - name: Adding additional GHA cache-related env vars + uses: actions/github-script@v8 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) + core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL']) + + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true + with: + enable-apt: true + + - name: Set up mini CTK + uses: ./.github/actions/fetch_ctk + continue-on-error: false + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ inputs.cuda-version }} + + # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH + # (set by fetch_ctk) must be available for both sdist and wheel builds. + - name: Build cuda.bindings sdist and wheel-from-sdist + run: | + export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) + export CC="sccache cc" + export CXX="sccache c++" + python -m build --sdist cuda_bindings/ + pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + + # cuda_core sdist delegates to setuptools (no CTK needed), but + # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via + # get_requires_for_build_wheel in build_hooks.py). + - name: Build cuda.core sdist and wheel-from-sdist + run: | + export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) + export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" + export CC="sccache cc" + export CXX="sccache c++" + export PIP_FIND_LINKS="$(pwd)/cuda_bindings/dist $(pwd)/cuda_pathfinder/dist" + python -m build --sdist cuda_core/ + pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz + + - name: Show sccache stats + if: always() + run: sccache --show-stats From d92d9c5d132e1c196cfed2db6f5384dd8bd6e75c Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 14 Apr 2026 15:12:00 -0400 Subject: [PATCH 2/4] fix: skip test-sdist job on doc-only PRs Match existing test jobs' doc-only guard so docs-only PRs don't run source-build validation. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aeb9dc3f17..94971bc710 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -291,7 +291,7 @@ jobs: - ci-vars - should-skip name: Test sdist - if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }} secrets: inherit uses: ./.github/workflows/test-sdist.yml with: From 46bcb8af0776dcbfd7c56bbbcf1c289c20586760 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 14 Apr 2026 15:47:42 -0400 Subject: [PATCH 3/4] fix: point cuda_bindings sdist build at local cuda_pathfinder wheel cuda_bindings build backend imports cuda.pathfinder, so pip's build isolation needs to find the locally-built cuda_pathfinder wheel instead of pulling from PyPI. Set PIP_FIND_LINKS to the pathfinder dist directory. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/test-sdist.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-sdist.yml b/.github/workflows/test-sdist.yml index 845e3438c9..49a68877cc 100644 --- a/.github/workflows/test-sdist.yml +++ b/.github/workflows/test-sdist.yml @@ -84,6 +84,7 @@ jobs: export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) export CC="sccache cc" export CXX="sccache c++" + export PIP_FIND_LINKS="$(pwd)/cuda_pathfinder/dist" python -m build --sdist cuda_bindings/ pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz From 47bccd81fd34c56d1e8db3764225bb01f3f0534f Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 14 Apr 2026 19:10:09 -0400 Subject: [PATCH 4/4] Add actionlint config for self-hosted runner labels actionlint rejects non-GitHub-hosted runner labels unless declared in .github/actionlint.yaml. This was causing pre-commit.ci failures on test-sdist.yml which uses linux-amd64-cpu8. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actionlint.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/actionlint.yaml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000000..af378f65b5 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Self-hosted runner labels used in CI workflows. +# Without this config, actionlint rejects non-GitHub-hosted labels. +self-hosted-runner: + labels: + - linux-amd64-cpu8