From b8eafbf6d0a6228e42d2f837406f11a9715ec88d Mon Sep 17 00:00:00 2001 From: Sokwhan Huh Date: Wed, 21 Jan 2026 09:51:49 -0800 Subject: [PATCH] OSS Fix for Bazel 9 PiperOrigin-RevId: 859145330 --- .bazelrc | 3 +++ BUILD.bazel | 7 +++++++ MODULE.bazel | 6 +++--- .../src/test/java/dev/cel/conformance/conformance_test.bzl | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index 31bb2d7bc..7bec7cc95 100644 --- a/.bazelrc +++ b/.bazelrc @@ -4,3 +4,6 @@ build --java_language_version=11 # Hide Java 8 deprecation warnings. common --javacopt=-Xlint:-options + +# Remove flag once https://github.com/google/cel-spec/issues/508 and rules_jvm_external is fixed. +common --incompatible_autoload_externally=proto_library,cc_proto_library,java_proto_library,java_test diff --git a/BUILD.bazel b/BUILD.bazel index 06942bc50..024908625 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -22,6 +22,13 @@ load( "DEFAULT_TOOLCHAIN_CONFIGURATION", "default_java_toolchain", ) +load( + "@rules_java//java:defs.bzl", + "java_binary", + "java_library", + "java_package_configuration", + "java_plugin", +) load("@rules_license//rules:license.bzl", "license") licenses(["notice"]) # Apache License 2.0 diff --git a/MODULE.bazel b/MODULE.bazel index 8e0e79068..b3a78627c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,14 +17,14 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.7.1") -bazel_dep(name = "rules_jvm_external", version = "6.7") +bazel_dep(name = "rules_jvm_external", version = "6.9") bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf") # see https://github.com/bazelbuild/rules_android/issues/373 bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33.bcr.1", repo_name = "com_google_googleapis") bazel_dep(name = "rules_pkg", version = "1.0.1") bazel_dep(name = "rules_license", version = "1.0.0") bazel_dep(name = "rules_proto", version = "7.1.0") bazel_dep(name = "rules_java", version = "8.12.0") -bazel_dep(name = "rules_android", version = "0.6.4") +bazel_dep(name = "rules_android", version = "0.7.1") bazel_dep(name = "rules_shell", version = "0.5.1") bazel_dep(name = "googleapis-java", version = "1.0.0") bazel_dep(name = "cel-spec", version = "0.24.0", repo_name = "cel_spec") @@ -39,7 +39,7 @@ GUAVA_VERSION = "33.5.0" TRUTH_VERSION = "1.4.4" -PROTOBUF_JAVA_VERSION = "4.33.0" +PROTOBUF_JAVA_VERSION = "4.33.4" # Compile only artifacts [ diff --git a/conformance/src/test/java/dev/cel/conformance/conformance_test.bzl b/conformance/src/test/java/dev/cel/conformance/conformance_test.bzl index fbae91b00..f884a2a84 100644 --- a/conformance/src/test/java/dev/cel/conformance/conformance_test.bzl +++ b/conformance/src/test/java/dev/cel/conformance/conformance_test.bzl @@ -17,6 +17,7 @@ This module contains build rules for generating the conformance test targets. """ load("@rules_java//java:defs.bzl", "java_test") +load("@rules_shell//shell:sh_test.bzl", "sh_test") # Converts the list of tests to skip from the format used by the original Go test runner to a single # flag value where each test is separated by a comma. It also performs expansion, for example @@ -79,7 +80,7 @@ def conformance_test(name, data, mode = MODE.TEST, skip_tests = []): ], ) - native.sh_test( + sh_test( name = name, size = "small", srcs = ["//conformance/src/test/java/dev/cel/conformance:conformance_test.sh"],