Repository navigation
Remove unused kotlin_toolchain from root BUILD - #5416
Merged
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_1035583258
branch
from
December 4, 2026 20:09
c88802c to
6bd6ee3
Compare
## Description rules_kotlin 2.4.10 removed the legacy `//kotlin:kotlin.bzl` entrypoint, and rules_kotlin 2.4.21 restricts `language_version` to 2.0 through 2.4. Any Bzlmod build that resolves rules_kotlin 2.4.10 or later fails while loading Dagger's root package (for example, as an external `@dagger` dependency): ``` ERROR: error loading package '@@dagger+//': cannot load '@@rules_kotlin+//kotlin:kotlin.bzl': no such file ``` `define_kt_toolchain(name = "kotlin_toolchain", ...)` in the root `BUILD` file has been unregistered since Dagger's Bzlmod migration (commit `e39cbf645` removed `register_toolchains("//:kotlin_toolchain")` from `WORKSPACE` without adding it to `MODULE.bazel`) and has no remaining references in the repository. Dagger's Bazel builds use rules_kotlin's built-in default toolchain instead. This PR removes both the legacy `//kotlin:kotlin.bzl` load and the unused `//:kotlin_toolchain` target from the root `BUILD` file. ## Testing Bazel 8.5.0 (`.bazelversion`), rules_kotlin 2.3.20 (`MODULE.bazel`) unless noted: - `bazel build //java/dagger/...`: passes. - `bazel test --keep_going //...`: 962/962 tests pass (cached after removing the unregistered target; 0 test inputs were invalidated. `examples/bazel` is in `.bazelignore` and pins a released Dagger through `archive_override`, so this change does not affect it). - With `rules_kotlin` locally bumped to 2.4.21 in `MODULE.bazel` (not part of this PR): - `master`: `bazel build --nobuild //:kotlin_toolchain` fails with `error loading package '': cannot load '@@rules_kotlin+//kotlin:kotlin.bzl': no such file`. - This branch: `bazel build` on `//dagger-spi/main/java/dagger/spi/model/...`, `//dagger-lint/main/java/dagger/lint/...`, `//hilt-compiler/main/java/dagger/hilt/processor/internal/...`, and `//dagger-compiler/main/java/dagger/internal/codegen/xprocessing/...` passes (71 targets). Fixes #5414 RELNOTES=N/A COPYBARA_INTEGRATE_REVIEW=#5414 from 06393993:kotlin-core-bzl 5f962c1 PiperOrigin-RevId: 1036566074
copybara-service
Bot
force-pushed
the
test_1035583258
branch
from
December 4, 2026 20:45
6bd6ee3 to
2bdd359
Compare
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.
Remove unused
kotlin_toolchainfrom rootBUILDDescription
rules_kotlin 2.4.10 removed the legacy
//kotlin:kotlin.bzlentrypoint, and rules_kotlin 2.4.21restricts
language_versionto 2.0 through 2.4. Any Bzlmod build that resolves rules_kotlin 2.4.10 orlater fails while loading Dagger's root package (for example, as an external
@daggerdependency):define_kt_toolchain(name = "kotlin_toolchain", ...)in the rootBUILDfile has been unregistered sinceDagger's Bzlmod migration (commit
e39cbf645removedregister_toolchains("//:kotlin_toolchain")fromWORKSPACEwithout adding it toMODULE.bazel) and has no remaining references in the repository. Dagger'sBazel builds use rules_kotlin's built-in default toolchain instead.
This PR removes both the legacy
//kotlin:kotlin.bzlload and the unused//:kotlin_toolchaintarget fromthe root
BUILDfile.Testing
Bazel 8.5.0 (
.bazelversion), rules_kotlin 2.3.20 (MODULE.bazel) unless noted:bazel build //java/dagger/...: passes.bazel test --keep_going //...: 962/962 tests pass (cached after removing the unregistered target; 0 testinputs were invalidated.
examples/bazelis in.bazelignoreand pins a released Dagger througharchive_override, so this change does not affect it).rules_kotlinlocally bumped to 2.4.21 inMODULE.bazel(not part of this PR):master:bazel build --nobuild //:kotlin_toolchainfails witherror loading package '': cannot load '@@rules_kotlin+//kotlin:kotlin.bzl': no such file.bazel buildon//dagger-spi/main/java/dagger/spi/model/...,//dagger-lint/main/java/dagger/lint/...,//hilt-compiler/main/java/dagger/hilt/processor/internal/...,and
//dagger-compiler/main/java/dagger/internal/codegen/xprocessing/...passes (71 targets).Fixes #5414
RELNOTES=N/A
FUTURE_COPYBARA_INTEGRATE_REVIEW=#5414 from 06393993:kotlin-core-bzl 5f962c1