From 07bbd98695cc5990561bf42b9d1daad04db17e6d Mon Sep 17 00:00:00 2001 From: Sam Berlin Date: Mon, 6 May 2024 09:31:51 -0700 Subject: [PATCH] internal change PiperOrigin-RevId: 631089588 --- .github/workflows/ci.yml | 2 +- WORKSPACE | 6 +++--- core/test/com/google/inject/BUILD | 4 ++++ .../com/googlecode/guice/BytecodeGenTest.java | 4 +++- .../com/google/inject/assistedinject/BUILD | 20 +++++++++++++++---- .../test/com/google/inject/persist/BUILD | 10 ++++++++-- .../com/google/inject/persist/config/BUILD | 5 +++-- .../test/com/google/inject/servlet/BUILD | 10 ++++++++-- .../test/com/google/inject/spring/BUILD | 10 ++++++++-- .../com/google/inject/throwingproviders/BUILD | 10 ++++++++-- 10 files changed, 62 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef75281ae1..5710b657c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: continuous-integration env: - USE_BAZEL_VERSION: '6.2.0' + USE_BAZEL_VERSION: '7.1.1' USE_JAVA_DISTRIBUTION: 'zulu' USE_JAVA_VERSION: '11' diff --git a/WORKSPACE b/WORKSPACE index ebf489b7ed..03790485dc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -16,9 +16,9 @@ load("@rules_jvm_external//:specs.bzl", "maven") http_archive( name = "google_bazel_common", - sha256 = "82a49fb27c01ad184db948747733159022f9464fc2e62da996fa700594d9ea42", - strip_prefix = "bazel-common-2a6b6406e12208e02b2060df0631fb30919080f3", - urls = ["https://github.com/google/bazel-common/archive/2a6b6406e12208e02b2060df0631fb30919080f3.zip"], + sha256 = "cba2aff0fb5e64dae880c8e1ead1b8d414a12b8e924315fac1a067de78a65e81", + strip_prefix = "bazel-common-d59d067c04e973f3c4aa34f6628bed97d6664c3c", + urls = ["https://github.com/google/bazel-common/archive/d59d067c04e973f3c4aa34f6628bed97d6664c3c.zip"], ) load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules") diff --git a/core/test/com/google/inject/BUILD b/core/test/com/google/inject/BUILD index 8186f11a73..fce9a1cd50 100644 --- a/core/test/com/google/inject/BUILD +++ b/core/test/com/google/inject/BUILD @@ -102,6 +102,7 @@ guice_test_suites( deps = [ ":add_opens_tests", ":tests", + "//core/src/com/google/inject", # bazel requires this b/c of package_info.java ], ) @@ -121,6 +122,7 @@ guice_test_suites( deps = [ ":add_opens_tests", ":tests", + "//core/src/com/google/inject", # bazel requires this b/c of package_info.java ], ) @@ -142,6 +144,7 @@ guice_test_suites( deps = [ ":add_opens_tests", ":tests", + "//core/src/com/google/inject", # bazel requires this b/c of package_info.java ], ) for include_stack_trace_option in [ "OFF", @@ -165,6 +168,7 @@ guice_test_suites( deps = [ ":add_opens_tests", ":tests", + "//core/src/com/google/inject", # bazel requires this b/c of package_info.java ], ) for custom_class_loading_option in [ "OFF", diff --git a/core/test/com/googlecode/guice/BytecodeGenTest.java b/core/test/com/googlecode/guice/BytecodeGenTest.java index 0e38113ee5..6fe34ab779 100644 --- a/core/test/com/googlecode/guice/BytecodeGenTest.java +++ b/core/test/com/googlecode/guice/BytecodeGenTest.java @@ -155,7 +155,9 @@ protected Class loadClass(final String name, final boolean resolve) // standard bootdelegation of java.* return super.loadClass(name, resolve); - } else if (!name.contains(".internal.")) { + } else if (!name.contains(".internal.") || name.contains("InternalFlags")) { + // Note: the !!contains(InternalFlags) shouldn't be necessary, + // but Bazel 7.1.1 w/ JDK11 seems to have a weird classloader that causes issues w/o it. /* * load public and test classes directly from the classpath - we don't diff --git a/extensions/assistedinject/test/com/google/inject/assistedinject/BUILD b/extensions/assistedinject/test/com/google/inject/assistedinject/BUILD index ad4df7a31f..58e6a1d331 100644 --- a/extensions/assistedinject/test/com/google/inject/assistedinject/BUILD +++ b/extensions/assistedinject/test/com/google/inject/assistedinject/BUILD @@ -47,7 +47,10 @@ java_library( guice_test_suites( name = "gen_tests", sizes = ["small"], - deps = [":tests"], + deps = [ + ":tests", + "//extensions/assistedinject/src/com/google/inject/assistedinject", # bazel requires this b/c of package_info.java + ], ) [guice_test_suites( @@ -59,7 +62,10 @@ guice_test_suites( "small", ], suffix = "_stack_trace_%s" % include_stack_trace_option, - deps = [":tests"], + deps = [ + ":tests", + "//extensions/assistedinject/src/com/google/inject/assistedinject", # bazel requires this b/c of package_info.java + ], ) for include_stack_trace_option in [ "OFF", ]] @@ -69,7 +75,10 @@ guice_test_suites( srcs = ["subpkg/SubpackageTestPrivateFallbackOnly.java"], sizes = ["small"], suffix = "SubpackageTestPrivateFallbackOnly", - deps = [":SubpackageTestPrivateFallbackOnly"], + deps = [ + ":SubpackageTestPrivateFallbackOnly", + "//extensions/assistedinject/src/com/google/inject/assistedinject", # bazel requires this b/c of package_info.java + ], ) [guice_test_suites( @@ -82,7 +91,10 @@ guice_test_suites( "small", ], suffix = "_SubpackageTestPrivateFallbackOnly_stack_trace_%s" % include_stack_trace_option, - deps = [":SubpackageTestPrivateFallbackOnly"], + deps = [ + ":SubpackageTestPrivateFallbackOnly", + "//extensions/assistedinject/src/com/google/inject/assistedinject", # bazel requires this b/c of package_info.java + ], ) for include_stack_trace_option in [ "OFF", ]] diff --git a/extensions/persist/test/com/google/inject/persist/BUILD b/extensions/persist/test/com/google/inject/persist/BUILD index 2e6704abd9..7471caeff5 100644 --- a/extensions/persist/test/com/google/inject/persist/BUILD +++ b/extensions/persist/test/com/google/inject/persist/BUILD @@ -41,7 +41,10 @@ guice_test_suites( "small", "medium", ], - deps = [":tests"], + deps = [ + ":tests", + "//extensions/persist/src/com/google/inject/persist", # bazel requires this b/c of package_info.java + ], ) [guice_test_suites( @@ -52,7 +55,10 @@ guice_test_suites( "medium", ], suffix = "_stack_trace_%s" % include_stack_trace_option, - deps = [":tests"], + deps = [ + ":tests", + "//extensions/persist/src/com/google/inject/persist", # bazel requires this b/c of package_info.java + ], ) for include_stack_trace_option in [ "OFF", ]] diff --git a/extensions/persist/test/com/google/inject/persist/config/BUILD b/extensions/persist/test/com/google/inject/persist/config/BUILD index 0ed64d4e15..c5126c34f1 100644 --- a/extensions/persist/test/com/google/inject/persist/config/BUILD +++ b/extensions/persist/test/com/google/inject/persist/config/BUILD @@ -11,7 +11,8 @@ genrule( name = "metainf", srcs = glob(["META-INF/*"]), outs = ["jpa-manifest.jar"], - cmd = "$(location @local_jdk//:jar) cvf $@ -C " + + cmd = "$(JAVABASE)/bin/jar cvf $@ -C " + "extensions/persist/test/com/google/inject/persist/config META-INF", - tools = ["@local_jdk//:jar"], + toolchains = ["@bazel_tools//tools/jdk:current_java_runtime"], + tools = ["@bazel_tools//tools/jdk:current_java_runtime"], ) diff --git a/extensions/servlet/test/com/google/inject/servlet/BUILD b/extensions/servlet/test/com/google/inject/servlet/BUILD index 8b6c842962..a615bf080d 100644 --- a/extensions/servlet/test/com/google/inject/servlet/BUILD +++ b/extensions/servlet/test/com/google/inject/servlet/BUILD @@ -29,7 +29,10 @@ guice_test_suites( "small", "medium", ], - deps = [":tests"], + deps = [ + ":tests", + "//extensions/servlet/src/com/google/inject/servlet", # bazel requires this b/c of package_info.java + ], ) [guice_test_suites( @@ -42,7 +45,10 @@ guice_test_suites( "medium", ], suffix = "_stack_trace_%s" % include_stack_trace_option, - deps = [":tests"], + deps = [ + ":tests", + "//extensions/servlet/src/com/google/inject/servlet", # bazel requires this b/c of package_info.java + ], ) for include_stack_trace_option in [ "OFF", ]] diff --git a/extensions/spring/test/com/google/inject/spring/BUILD b/extensions/spring/test/com/google/inject/spring/BUILD index 8b7f71078b..a4b7920c27 100644 --- a/extensions/spring/test/com/google/inject/spring/BUILD +++ b/extensions/spring/test/com/google/inject/spring/BUILD @@ -21,7 +21,10 @@ java_library( guice_test_suites( name = "gen_tests", sizes = ["small"], - deps = [":tests"], + deps = [ + ":tests", + "//extensions/spring/src/com/google/inject/spring", # bazel requires this b/c of package_info.java + ], ) [guice_test_suites( @@ -31,7 +34,10 @@ guice_test_suites( "small", ], suffix = "_stack_trace_%s" % include_stack_trace_option, - deps = [":tests"], + deps = [ + ":tests", + "//extensions/spring/src/com/google/inject/spring", # bazel requires this b/c of package_info.java + ], ) for include_stack_trace_option in [ "OFF", ]] diff --git a/extensions/throwingproviders/test/com/google/inject/throwingproviders/BUILD b/extensions/throwingproviders/test/com/google/inject/throwingproviders/BUILD index e4e9b2f266..9f62b22867 100644 --- a/extensions/throwingproviders/test/com/google/inject/throwingproviders/BUILD +++ b/extensions/throwingproviders/test/com/google/inject/throwingproviders/BUILD @@ -23,7 +23,10 @@ java_library( guice_test_suites( name = "gen_tests", sizes = ["small"], - deps = [":tests"], + deps = [ + ":tests", + "//extensions/throwingproviders/src/com/google/inject/throwingproviders", # bazel requires this b/c of package_info.java + ], ) [guice_test_suites( @@ -35,7 +38,10 @@ guice_test_suites( "small", ], suffix = "_stack_trace_%s" % include_stack_trace_option, - deps = [":tests"], + deps = [ + ":tests", + "//extensions/throwingproviders/src/com/google/inject/throwingproviders", # bazel requires this b/c of package_info.java + ], ) for include_stack_trace_option in [ "OFF", ]]