Skip to content

cuda: declare //cuda:toolchain_type without loading rules_cuda, so cuda/private/toolchain/hub stops being public (follow-up of #10073) #14447

Closed

Description

@TrapsterDK

Follow-up of #10073. cuda/private/toolchain/hub/BUILD.bazel is public (package(default_visibility = ["//visibility:public"])) and has no private-visibility allowlist line, so //tools/testing:language_skeleton_test reports it on main. The hub owns the CUDA toolchain_type, which layout.md puts at @rules_dx//cuda:toolchain_type. The type can't simply move to cuda/BUILD.bazel: that file loads //cuda/private:defs.bzl, which loads @rules_cuda. Every registered toolchain names its type, so rules_cuda would come back on the toolchain-resolution path that #14360 took it off.

Where

  • cuda/private/toolchain/hub/BUILD.bazel:3 (public package default), :5 (toolchain_type), :13 and the second toolchain() (toolchain_type = ":toolchain_type").
  • cuda/BUILD.bazel:3 loads //cuda/private:defs.bzl for the cublas, cufft and curand cuda_component_library targets.
  • cuda/private/toolchain/check.bzl:7 (_TOOLCHAIN_TYPE).
  • patches/rules_cuda/toolchain_type_alias.patch:9 (alias actual).

Fix

  • Move the three cuda_component_library targets into a cuda/private package. Keep @rules_dx//cuda:cublas, :cufft and :curand as public aliases in cuda/BUILD.bazel, the way ocaml/BUILD.bazel aliases //ocaml/private/.... Then cuda/BUILD.bazel loads no rules_cuda .bzl.
  • Declare toolchain_type(name = "toolchain_type", visibility = ["//visibility:public"]) in cuda/BUILD.bazel. Point the hub toolchains, check.bzl:7 and the patch at //cuda:toolchain_type, and narrow the hub package default to //:__subpackages__ (registration doesn't check visibility).
  • Run bazel run //tools/api:update, //cuda/tests:all, //tools/testing:toolchain_gate_test, //tools/testing:language_skeleton_test and //tools/testing/consumer:cold_start_test. The cold-start lists must not gain rules_cuda.

Activity

  1. added
    P2
    cloud-pool
    on Nov 21, 2026
  2. TrapsterDK commented on Nov 21, 2026

    @TrapsterDK
    CollaboratorAuthor

    cloud-claim d04a3080


    Generated by Claude Code

  3. added
    cloud-taken
    and removed
    cloud-pool
    on Nov 21, 2026
  4. TrapsterDK commented on Nov 21, 2026

    @TrapsterDK
    CollaboratorAuthor

    Next slice: #14521 moves the type to //cuda:toolchain_type and makes the hub private. It is draft until the cold_start_test evidence run passes. After that, MODULE.bazel still registers //cuda/private/toolchain/hub:all, and the language skeleton test reports that as register-label. To fix it, register the toolchains through a dx_cuda_toolchains hub repo.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2cloud-taken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions