Skip to content

ci: constrain internal builds to exact local wheels - #2510

Open
rwgk wants to merge 3 commits into
mainfrom
rwgk/stacked/ci/exact_local_wheel_constraints
Open

ci: constrain internal builds to exact local wheels#2510
rwgk wants to merge 3 commits into
mainfrom
rwgk/stacked/ci/exact_local_wheel_constraints

Conversation

@rwgk

@rwgk rwgk commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #2468.

xref: #2464, #2470

Same-checkout CI builds must use the exact CUDA Python wheel artifacts selected by the workflow. A compatible package from PyPI must not satisfy an internal build dependency when CI intends to exercise a local artifact.

This PR generates PEP 508 direct-reference constraints for the selected cuda-pathfinder and cuda-bindings wheels, for example:

cuda-pathfinder @ file:///.../cuda_pathfinder-...whl
cuda-bindings @ file:///.../cuda_bindings-...whl

The workflows apply each constraint file through both PIP_BUILD_CONSTRAINT and PIP_CONSTRAINT. This constrains dependencies installed into PEP 517 isolated build environments as well as other pip dependency resolution in the build step, while leaving package indexes available for unrelated third-party dependencies.

PRs #2509 and #2520 report the versions and import locations of build dependencies. Those diagnostics make the selected artifacts visible in CI logs; the constraints in this PR enforce their selection.

Dependency constraints

The protected build edges are:

Consumer build Required wheel artifacts
cuda.bindings exactly one workflow-built cuda-pathfinder wheel
current-major cuda.core exactly one cuda-pathfinder wheel and one cuda-bindings wheel matching the current CUDA major
previous-major cuda.core exactly one cuda-pathfinder wheel and one downloaded cuda-bindings wheel matching the previous CUDA major

Each constraint-generation step verifies that exactly one matching artifact exists before starting the consumer build. The previous-major bindings artifact is kept in a separate directory so current- and previous-major wheels cannot become an ambiguous input set.

The direct references use paths appropriate to each execution environment:

  • Linux cibuildwheel builds use the container-visible /host mount.
  • Windows builds convert paths with cygpath for Git Bash and native pip subprocesses.
  • Native Linux workflow steps use absolute file URLs.

Affected environments install pip 25.3 or newer for build-constraint support.

Workflow coverage

The constraints are applied consistently across:

  • production Linux and Windows wheel builds, including the previous-CUDA-major cuda.core build;
  • Linux and Windows coverage builds; and
  • Linux and Windows wheel-from-sdist tests.

The policy is contained entirely in CI configuration. Package build requirements and ordinary builds without these constraint variables are unchanged.

@copy-pr-bot

copy-pr-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI/CD CI/CD infrastructure label Aug 5, 2026
@rwgk rwgk self-assigned this Aug 5, 2026
@rwgk rwgk added the P0 High priority - Must do! label Aug 5, 2026
@rwgk rwgk added this to the cuda.bindings next milestone Aug 5, 2026
@rwgk

rwgk commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test

@rwgk
rwgk marked this pull request as ready for review August 5, 2026 15:14
@rwgk
rwgk requested review from juenglin and kkraus14 August 5, 2026 15:27
Base automatically changed from rwgk/stacked/ci/build_dependency_provenance to main August 6, 2026 04:01
@rwgk
rwgk force-pushed the rwgk/stacked/ci/exact_local_wheel_constraints branch from a571b64 to 472b7cd Compare August 6, 2026 04:01
@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 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.

@rwgk
rwgk force-pushed the rwgk/stacked/ci/exact_local_wheel_constraints branch from 472b7cd to f39b4c0 Compare August 6, 2026 06:00
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

@rwgk
rwgk force-pushed the rwgk/stacked/ci/exact_local_wheel_constraints branch from f39b4c0 to 5fcc5fd Compare August 6, 2026 09:45
@rwgk
rwgk changed the base branch from main to rwgk/stacked/ci/report_current_cuda_bindings_provenance August 6, 2026 09:45
Base automatically changed from rwgk/stacked/ci/report_current_cuda_bindings_provenance to main August 6, 2026 16:09
@rwgk
rwgk force-pushed the rwgk/stacked/ci/exact_local_wheel_constraints branch 2 times, most recently from 3e8866f to 9eb4470 Compare August 6, 2026 16:11
@rwgk

rwgk commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@kkraus14 This PR now keeps dependency selection entirely in CI, uses exact constraints for both pathfinder and bindings across every in-scope workflow, and no longer changes either build hook. I plan to merge after clean CI unless you see a remaining blocker.

(At this moment the CI is very unreliable b/o infrastructure issues; I'll keep retrying; we had a clean run before I merged 2520, therefore I believe it should work again.)

@kkraus14 kkraus14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reposting comment I made offline:

There is so much unnecessary added complexity here. We shouldn't need a whole python helper for constraint file generation. We already know the exactly wheel we built earlier for dependencies so we can easily just pass that information through in the GitHub Action workflows.

@rwgk
rwgk force-pushed the rwgk/stacked/ci/exact_local_wheel_constraints branch from 9eb4470 to 2126160 Compare August 7, 2026 04:05
@rwgk

rwgk commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@kkraus14, I removed the Python helper and moved the constraint generation directly into the workflows, following your suggestion. CI is running, and I've updated the PR description to reflect the new implementation. Could you please take another look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: CI may build cuda.core against published cuda-bindings instead of the same-commit wheel

3 participants