Add system-provided CUDA library targets - #18
Merged
Merged
Conversation
cjm-dd
marked this pull request as ready for review
August 14, 2026 19:23
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.
Summary
Adds a system-provided sibling for each CUDA shared-library target. Consumers can select
foo_systemwhen CUDA is supplied by the runtime environment, while the existingfooandfoo_statictargets keep their current behavior.At the lowest layer, each existing
cc_importnamed*_shared_librarynow has a matching*_interface_libraryimport withsystem_provided = True. The publicfoo_systemwrappers mirror the dependency relationships offoo, while the interface imports themselves remain independent of other interface imports. This keeps the imports lightweight and makes composition explicit at the public target layer.Header dependency closure now lives on each component's
headerstarget. As a result, shared, static, and system-provided variants all receive the headers they need, but the system-provided graph does not acquire any packaged*_shared_librarytargets.The interface imports prefer NVIDIA's lightweight linker stubs under
lib/stubs/whenever the redistribution ships them. Archives without a stub use the unversioned DSO as the interface-only linker input. The relevant component archives were checked across every supported CUDA version and applicable Linux x86_64/SBSA variant; the notable compatibility exception is CUDA 12.1.1'snvJitLinkarchive, which does not contain a stub and therefore falls back tolib/libnvJitLink.so.The README documents the new target convention and the requirement that
foo_systemconsumers provide the corresponding runtime libraries.Validation
buildifier -mode=checkon the changed BUILD and Starlark filesgit diff --check*_shared_librarylabels