build: report cuda-bindings provenance in PEP 517 builds - #2520
Merged
rwgk merged 1 commit intoAug 6, 2026
Conversation
Resolve the CUDA path before importing cuda.bindings so the existing pathfinder import repairs PEP 517 namespace shadowing first. Reuse the resolved path for the CUDA include directory.
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. |
This was referenced Aug 6, 2026
Contributor
Author
|
/ok to test |
|
juenglin
approved these changes
Aug 6, 2026
rwgk
deleted the
rwgk/stacked/ci/report_current_cuda_bindings_provenance
branch
August 6, 2026 16:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related to #1824 and #2468.
Follow-up to #2509. This PR is intended to merge before #2510. #2510 separately enforces exact local-wheel selection, while this PR only makes the build hook's existing provenance reporting work consistently.
#2509 added a
cuda.corebuild-hook message that reports the importedcuda-bindingsversion and package directory. The message appears for previous-CTK CUDA 12 builds, but not for the 24 current-CTK CUDA 13 builds (see #2468 (comment) for a full report).The difference comes from call ordering in the PEP 517 in-tree backend.
cuda_core/build_hooks.pytries to importcuda.bindingsbefore calling_get_cuda_path(). At that point,backend-path = ["."]can leave the repository'scuda_core/cudadirectory cached as the only path in thecudanamespace, so the installed build dependency is not visible. The import failure is then suppressed by the existing best-effort guard._get_cuda_path()invokes the namespace repair documented in #1824, but currently does so only after that import attempt.CUDA 12 wheels happen not to expose the problem because they still contain the historical
_cuda_bindings_redirector.pth, which importscudaduring interpreter startup. That redirector stopped shipping with CUDA 13 as part of #792, explaining why only the previous-CTK builds currently reach the provenance print.This PR moves the existing
_get_cuda_path()call ahead of thecuda.bindingsimport and reuses its result later in the build. The namespace is therefore repaired before the import, allowing the existing #2509 message to report the CUDA 13 dependency's version and location and allowing the existing Cython path setup to use that imported package.This does not change build requirements or dependency-resolution policy.
_get_cuda_path()was already mandatory later in the same function, so the functional change is limited to performing that lookup earlier.