Skip to content

Commit bb287be

Browse files
authored
[29.x] Add missing java load (#19016)
* Add missing java load 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 * Dummy commit to force CI re-trigger
1 parent 63d966b commit bb287be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

java/core/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel_skylib//rules:build_test.bzl", "build_test")
2+
load("@rules_java//java:java_library.bzl", "java_library")
23
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
34
load("//:protobuf.bzl", "internal_gen_well_known_protos_java")
45
load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
@@ -705,3 +706,4 @@ pkg_files(
705706
strip_prefix = strip_prefix.from_root(""),
706707
visibility = ["//java:__pkg__"],
707708
)
709+

0 commit comments

Comments
 (0)