google / google/j2cl

Can't run j2cl on Bazel 6

Open
#200 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
161
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I'm trying to run some J2CL builds on a Bazel 6 project, but I encounter the following error:
```
INFO: Invocation ID: a1fff5c4-4b69-439d-a75f-e730e8c490f7
ERROR: /private/var/tmp/_bazel_sam/89d3dd8c1880937e8b55a8dc2c815fe0/external/bazel_tools/tools/jdk/BUILD:124:6: no such target '@rules_java~6.2.2~toolchains~local_jdk//:jar': target 'jar' not declared in package '' defined by /private/var/tmp/_bazel_sam/89d3dd8c1880937e8b55a8dc2c815fe0/external/rules_java~6.2.2~toolchains~local_jdk/BUILD.bazel (Tip: use `query "@@rules_java~6.2.2~toolchains~local_jdk//:*"` to see all the targets in that package) and referenced by '@bazel_tools//tools/jdk:jar'
```

I'm using `bzlmod` with `rules_java`, which seems to be doing something creative with `local_jdk`. Is there any way I can fix this?

**To Reproduce**
It's a brand new Bazel 6 project with J2CL added via the standard directions. I can provide a reproducer if needed.

**Bazel version**
Please include version of Bazel that you are running J2CL with:
```
Aspect CLI version: 5.5.4
Build label: 6.2.1
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 2 17:00:10 2023 (1685725210)
Build timestamp: 1685725210
Build timestamp as int: 1685725210
```

**Expected behavior**
It should be able to run the build under Bazel 6, ideally.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.