Skip to content

Commit

Permalink
Add missing java load
Browse files Browse the repository at this point in the history
For most _native_ loads of Java rules (e.g. java_library), these can be automatically handled by Bazel 8's autoload feature.

However, this is not the case when the main repository (IOW, the repository currently being built) is a rule repo itself. In those cases, module dependencies are not automatically loaded.

This PR fixes a compatibility issue of OSS protobuf Bazel rules with other Bazel rule repositories such as bazelbuild/rules_android.

Without this PR, builds within rules repositories with Bazel 8 will fail like so:

```
external/protobuf+/java/core/BUILD.bazel:142:13: @@protobuf+//java/core:lite: no such attribute 'srcs' in 'java_library' rule
```

PiperOrigin-RevId: 690735533
  • Loading branch information
ted-xie authored and copybara-github committed Oct 28, 2024
1 parent 43570f2 commit 89533c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions java/core/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_java//java:java_library.bzl", "java_library")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
load("//:protobuf.bzl", "internal_gen_well_known_protos_java")
load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
Expand Down

0 comments on commit 89533c7

Please sign in to comment.