Fix three recent cuda.core build and CI issues - #2470
Conversation
|
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. |
|
/ok to test |
|
Added follow-up commit 71502ad to fix the unrelated API-check failure exposed by this PR. It is not a flake:
The command used The commit replaces I kept this as a separate commit because the same issue is also being handled in #2464; it can be dropped easily if that PR lands first. Validation:
|
|
/ok to test |
|
|
Thanks @kkraus14 for pointing me to #2464. I did a fresh cross-check before continuing with this PR, since #2464 now overlaps with #2470 in three areas:
The exact-wheel work in #2464 is a valid solution for the production wheel workflow. Its direct-file constraints prevent an index candidate from taking precedence, and an earlier CI run surfaced the original Cython mismatch, which is useful confirmation that the local development wheel was selected. That approach also fits #2464's broader selective-build and artifact-reuse work, and it additionally constrains #2470 takes a different approach for issue #2468: the The Based on this cross-check, I think it still makes sense to continue #2470 as the focused fix for #2468. In particular, #2464 does not currently apply its exact bindings constraint to the sdist or coverage workflows. At the same time, its constraint-based implementation remains useful within the selective-build work. Whichever PR lands second will need a small rebase and de-duplication of the overlapping cast and API-check changes. I wanted to record the comparison here so it is clear that #2470 is continuing with the current state of #2464 taken into account. |
|
/ok to test |
Summary
This PR fixes three unrelated issues that recently slipped into the
cuda.corebuild and CI paths:cuda.coreagainst a publishedcuda-bindingswheel from PyPI instead of the wheel produced by the current workflow.cuda-bindingsdeclaration.cuda.coreAPI check could fail with SIGPIPE underpipefaileven after finding a valid release tag.The issues happened to surface together while validating recent changes, but each fix is independent and remains in a separate commit.
1. Build cuda.core against the exact same-checkout cuda-bindings wheel
The
cuda.corebuild backend requestscuda-bindings==<CUDA major>.*. CI previously made its newly built development wheel available only throughPIP_FIND_LINKS.PIP_FIND_LINKSadds candidates without prioritizing them over the package index. A published stable wheel can therefore beat a same-checkout development wheel when prereleases are not enabled. Enabling prereleases is not sufficient either, because a different, newer index candidate could still win. Even an exact version pin would leave the artifact source ambiguous if a tagged build were rerun after publication.As a result, CI could successfully build current
cuda.coresources against declarations from an older or otherwise unrelated publishedcuda-bindingspackage. The standard wheel tests install the current bindings wheel only after the core wheel has already been Cythonized, so they did not detect this mismatch. This is the false-green behavior described in #2468.The build backend now recognizes the CI-only
CUDA_CORE_BUILD_BINDINGS_WHEEL_DIRenvironment variable:cuda-bindings==<CUDA major>.*requirementcuda_bindings-<major>.*.whlcuda-bindings @ file://...build requirementFiltering by CUDA major allows current- and previous-major wheels to coexist in one artifact directory while still making the selected dependency unambiguous.
The local artifact directory is wired into every same-checkout pip/PEP 517
cuda.corebuild in CI:Linux coverage now retains and installs a locally built bindings wheel before building core. Existing
PIP_FIND_LINKSandPIP_PREsettings remain only where they are needed to keep the same-checkout prereleasecuda-pathfindereligible; bindings selection no longer depends on pip candidate ranking.Intentional compatibility coverage is unchanged. The explicit
BINDINGS_SOURCE=publishedrows continue testing released same-major, older-minorcuda-bindingswheels from PyPI, and isolated Pixi environments that intentionally resolve published packages are unaffected. The analogous staticcuda-pathfinderbuild-dependency selection is outside this PR.Closes #2468.
2. Fix the graph memcpy host-source pointer cast
The current
cuda-bindingsdeclaration exposesCUDA_MEMCPY3D.srcHostasvoid *, but a refactor in #2395 unintentionally restored aconst void *cast incuda.core. Cython correctly rejected assigning that const-qualified pointer to the mutable field because it discards the qualifier.The assignment now casts the source address to
void *, matching the current declaration. A mutable pointer remains assignable when building against an older declaration that acceptsconst void *, so this keeps the intentional published-bindings compatibility path valid as well.This source incompatibility had been masked by the first issue: CI was Cythonizing against the older published declaration rather than the current same-checkout PXD. Selecting the exact local bindings wheel exposed the failure and made the one-line correction necessary. The change does not alter structure layout, ABI, ownership, or runtime copy behavior.
3. Avoid SIGPIPE in the cuda.core API check
The API check selected the newest
cuda-core-v*release tag with:gh api ... --paginate | head -1The workflow runs with
set -o pipefail. Onceheadreceived the first matching tag, it closed the pipe whileghwas still paginating.ghthen received SIGPIPE and returned status 141, causing the job to fail even though tag selection had succeeded.The pipeline now uses
sed -n '1p'. It prints the first matching tag while continuing to consume the complete paginated stream, allowingghto finish normally. A genuinegh apifailure still propagates throughpipefail, and the existing explicit check for an empty tag remains unchanged.Validation
TestVenv/bin/python -m pytest -v --noconftest cuda_core/tests/test_build_hooks.py ci/tools/tests(61 passed)pre-commit run --all-files, including ruff, mypy, YAML validation, and actionlintgh apierrors still propagateCoordination with #2464
PR #2464 independently evolved to address overlapping parts of these build and CI issues as part of its broader selective-wheel-build work. The implementations were cross-checked, and the detailed comparison is recorded in the PR discussion. Whichever PR lands second can rebase and reconcile the overlapping changes.