8000 Remove unused `kotlin_toolchain` from root `BUILD` by copybara-service[bot] · Pull Request #5416 · google/dagger · GitHub
[go: up one dir, main page]

Skip to content

Remove unused kotlin_toolchain from root BUILD - #5416

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1035583258
Dec 4, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1035583258

Conversation

@copybara-service
Copy link
Copy Markdown

Remove unused kotlin_toolchain from root BUILD

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
FUTURE_COPYBARA_INTEGRATE_REVIEW=#5414 from 06393993:kotlin-core-bzl 5f962c1

@google-cla
google-cla Bot commented Dec 4, 2026
Copy link
Copy Markdown

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.

## 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
copybara-service Bot merged commit 2bdd359 into master Dec 4, 2026
3 of 4 checks passed
7834
@copybara-service
copybara-service Bot deleted the test_1035583258 branch December 4, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0