From bb287be772454d63b411b73d60b1d92daa879f2e Mon Sep 17 00:00:00 2001 From: Ted Date: Tue, 29 Oct 2024 14:15:16 -0400 Subject: [PATCH] [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 --- java/core/BUILD.bazel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/core/BUILD.bazel b/java/core/BUILD.bazel index 423f0bbb8a0d2..63b5f4af583a8 100644 --- a/java/core/BUILD.bazel +++ b/java/core/BUILD.bazel @@ -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") @@ -705,3 +706,4 @@ pkg_files( strip_prefix = strip_prefix.from_root(""), visibility = ["//java:__pkg__"], ) +