Repository navigation
ruby: own the Ruby toolchain type so registering it does not fetch rules_ruby - #14985
Merged
Merged
Conversation
…les_ruby The rules_dx extension still creates @dx_ruby_toolchains, but rules_dx now registers its own toolchain() targets from @dx_toolchains//ruby, typed by //ruby:toolchain_type and pointing at the per-platform aliases that bazel-contrib/rules_ruby#452 adds to the proxy repo. rules_ruby's //ruby:toolchain_type becomes an alias of ours, so its rules still resolve. The gate patch and the dx_hub_builds copy of the proxy BUILD are no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hvdpJxYihWhnWtH8yv
TrapsterDK
force-pushed
the
lazy-ruby-toolchain-type
branch
from
November 28, 2026 10:56
41799c3 to
aa5629b
Compare
Collaborator
Author
|
/evidence platforms=["linux_x86_64"] task=test scope=//tools/testing/consumer:network_test |
Contributor
|
/evidence could not dispatch evidence.yml on lazy-ruby-toolchain-type. |
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.
Every consumer fetched the rules_ruby archive and
@dx_ruby_toolchains, even without Ruby targets, becauseregister_toolchains("@dx_ruby_toolchains//:all")registered toolchains whose type is@rules_ruby//ruby:toolchain_type.Follows #14981 (same approach for .NET); it reuses that PR's
hub_order_testtoolchain_typescheck.//ruby:toolchain_typeis a new rules_dx toolchain type. The newruby/private/toolchains.BUILD.bazelis the@dx_toolchains//rubypackage: six gatedtoolchain()targets of that type, pointing at@dx_ruby_toolchains//:<platform>. MODULE.bazel registers@dx_toolchains//ruby:allinstead of@dx_ruby_toolchains//:all.patches/rules_ruby/toolchain_aliases.patchis feat: alias each platform's toolchain in the proxy repository bazel-contrib/rules_ruby#452: the proxy repo also emits onealias()per platform, so a module can declare its owntoolchain()targets.patches/rules_ruby/toolchain_type_alias.patchmakes@rules_ruby//ruby:toolchain_typean alias of ours, so rules_ruby's rules and the rules_dx rules that request the upstream label resolve the same toolchains.toolchains_gate.patchis gone: the proxy's owntoolchain()targets are no longer registered, and ours carry//config:toolchains_on.@dx_hub_buildsand thehub_buildsrepository rule are gone.hub_order_testreads the hub file directly.ruby_coveragestays inruby/extensions.bzl, which loads rules_ruby. The extension only runs when one of its repos is needed, so it doesn't make consumers fetch rules_ruby.rules_dx++dx_pins+rules_rubyandrules_dx++ruby+dx_ruby_toolchainsleave the go, java, java_check and rust cold-start lists.rules_rubyis aFOREIGNfragment for go, java and rust.external_reposbudgets go down by two each (core 227, python 230 / 241). These numbers are predicted; CI measures them.api/labels.txtanddocs/supported-surface.mdlist the new type.Upstream: bazel-contrib/rules_ruby#451 (issue), bazel-contrib/rules_ruby#452 (PR). The type alias patch stays rules_dx only: the type has to live outside the rules_ruby repo for the repo to go unfetched.
No local build or test was run (builder cap). CI and
/evidenceon this PR do the verification.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hvdpJxYihWhnWtH8yv