-
Notifications
You must be signed in to change notification settings - Fork 87
Use Turbine native image as header_compiler_direct
#151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@keertk Sorry for all the hoops this requires, but could you create another rules_java release with this change? |
|
@fmeum this breaks rules_jvm_external with crashing here https://github.com/google/turbine/blob/33ed406f653ecfda611933103261a6ad3146dbd5/java/com/google/turbine/binder/CtSymClassBinder.java#L52. Could you take a look? # a minimal repro
java_library(
name = "l",
srcs = ["t.java"],
javacopts = [
"--release",
"8",
],
)
java_binary(
name = "b",
srcs = ["t.java"],
main_class = "t.t",
deps = [":l"],
) |
|
@BoleynSu rules_java 7.3.1 is out with the fix. Please give it a try. |
|
rules_java 7.3.1 seems to not fix the issue. I post it here after both the
attempts to upgrade to 7.3.0 and 7.3.1 failed.
Sent from https://boleyn.su/phone
…On Sat, Dec 2, 2023, 14:34 Fabian Meumertzheim ***@***.***> wrote:
@BoleynSu <https://github.com/BoleynSu> rules_java 7.3.1 is out with the
fix. Please give it a try.
—
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXVSKB6UB5VFW7AAHMWGW3YHLDVTAVCNFSM6AAAAAA63CSJOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGA3DANJSGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@BoleynSu That does sound like a problem with updating rules_java. How are you doing that? With the following setup: # BUILD
java_library(
name = "l",
srcs = ["t.java"],
javacopts = [
"--release",
"8",
],
)
java_binary(
name = "b",
srcs = ["t.java"],
main_class = "t.t",
deps = [":l"],
)
# t.java
package t;
public class t {}
# MODULE.bazel
bazel_dep(name = "rules_java", version = "7.3.0")I get: $ USE_BAZEL_VERSION=7.0.0rc5 bazel build //:b
...
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
java.lang.NullPointerException: attempted to use --release, but JAVA_HOME is not set
at [email protected]/java.util.Objects.requireNonNull(Objects.java:259)
at com.google.turbine.binder.CtSymClassBinder.bind(CtSymClassBinder.java:52)
at com.google.turbine.main.Main.bootclasspath(Main.java:309)
at com.google.turbine.main.Main.compile(Main.java:142)
at com.google.turbine.main.Main.compile(Main.java:133)
at com.google.turbine.main.Main.main(Main.java:89)
Target //:b failed to buildWhen I update the |
|
I am still on Bazel 6.4.0. Maybe related?
Sent from https://boleyn.su/phone
…On Sat, Dec 2, 2023, 15:03 Fabian Meumertzheim ***@***.***> wrote:
@BoleynSu <https://github.com/BoleynSu> That does sound like a problem
with updating rules_java. How are you doing that?
With the following setup:
# BUILDjava_library(
name = "l",
srcs = ["t.java"],
javacopts = [
"--release",
"8",
],
)
java_binary(
name = "b",
srcs = ["t.java"],
main_class = "t.t",
deps = [":l"],
)
# t.javapackage t;
public class t {}
# MODULE.bazelbazel_dep(name = "rules_java", version = "7.3.0")
I get:
$ USE_BAZEL_VERSION=7.0.0rc5 bazel build //:b
...
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
java.lang.NullPointerException: attempted to use --release, but JAVA_HOME is not set
at ***@***.***/java.util.Objects.requireNonNull(Objects.java:259)
at com.google.turbine.binder.CtSymClassBinder.bind(CtSymClassBinder.java:52)
at com.google.turbine.main.Main.bootclasspath(Main.java:309)
at com.google.turbine.main.Main.compile(Main.java:142)
at com.google.turbine.main.Main.compile(Main.java:133)
at com.google.turbine.main.Main.main(Main.java:89)
Target //:b failed to build
When I update the rules_java version to 7.3.1, the build passes.
—
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXVSKDKQG7YQSNY552LZXTYHLHFXAVCNFSM6AAAAAA63CSJOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGA3DMNZUGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Yes, Bazel 6.4.0 doesn't contain bazelbuild/bazel@4a29f08, which is needed to make the Java rules pass |
|
I see. I am skipping 7.3.x for now. BoleynSu-Org/monorepo@770b1fc |
Adding a newer `rules_python` to `rules_magic_deps` _before_ `rules_proto` fixes the missing `rules_python` file error from the previous commit. rules_python 0.37.2 is the last version that doesn't pull in its own `protobuf`. `rules_python` 0.38.0 pulls in protobuf v27 unconditionally. 0.37.2 allows us to keep using rules_proto-5.3.0-21.7 for now. Also, `rules_python` 0.40.0 and later require newer `rules_cc` versions that may not play nice with `protobuf` v21.7. After we upgrade `protobuf` to a more recent version, we can upgrade to more recent `rules_python` version. For details: - bazel-contrib/rules_scala#1660 (comment) The build now produces the following failure: ```txt ERROR: external/remote_java_tools_darwin_arm64/BUILD: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD ERROR: external/rules_java_builtin/toolchains/BUILD:163:14: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD and referenced by '@@rules_java_builtin//toolchains:turbine_direct_graal_darwin_arm64' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Another `rules_java_builtin` and user-declared `rules_java` conflict due to the legacy `WORKSPACE` model: - `rules_java` 7.3.0 introduced the `turbine_direct_graal` target into its `//toolchains` package via: bazelbuild/rules_java#151: Use Turbine native image as `header_compiler_direct` bazelbuild/rules_java@d5b3ecf - As noted in "Bump to Bazel 7.6.2", the legacy `WORKSPACE` prefix creates `@rules_java_builtin`, which is actually `rules_java` 7.6.5. This version depends on `remote_java_tools` v13.6.1, whose repos contain `//:turbine_direct_graal`. Its `README.md` shows that it comes from bazelbuild/bazel@40ec2cd. https://github.com/bazelbuild/rules_java/blob/7.6.5/java/repositories.bzl#L25 https://github.com/bazelbuild/java_tools/releases/download/java_13.6.1/java_tools_darwin_arm64-v13.6.1.zip https://github.com/bazelbuild/bazel/blob/40ec2cd1a15d73473945475552ad1d0cb6d77927/tools/jdk/BUILD.java_tools_prebuilt#L26-L32 - The legacy `bootcamp/WORKSPACE` file invokes `rules_java_dependencies` from `rules_java` 6.5.2, instantiating `remote_java_tools` v12.6, whose repos do _not_ contain `//:turbine_direct_graal`. It comes from bazelbuild/bazel@bd91cb1. https://github.com/bazelbuild/rules_java/blob/6.5.2/java/repositories.bzl#L31 https://github.com/bazelbuild/java_tools/releases/download/java_v12.6/java_tools_darwin_arm64-v12.6.zip https://github.com/bazelbuild/bazel/blob/bd91cb131785a6693d45c7840a229d345e48d40b/tools/jdk/BUILD.java_tools_prebuilt - The legacy `WORKSPACE` suffix invokes `rules_java_dependencies` from `rules_java` 7.6.5. Since it wraps the `http_archive` repo rules instantiating `remote_java_tools` repos with `maybe`, nothing happens, because the repos already exist. - The legacy `WORKSPACE` suffix then invokes `rules_java_toolchains` from `rules_java` 7.6.5, which registers `//toolchains:all`. - That version of the `//toolchains` package aliases `"turbine_direct_graal_%s" % OS` to `"@remote_java_tools_%s//:turbine_direct_graal" % OS`. https://github.com/bazelbuild/rules_java/blob/7.6.5/toolchains/BUILD#L163-L166 - Since the `"@remote_java_tools_%s" % OS` repo doesn't contain a `turbine_direct_graal` target, analysis of `//toolchains:all` breaks. --- Another solution would've been to apply the following patch to remove `rules_proto` as a dependency and rely only on `com_google_protobuf`. However, we'll keep `rules_proto` to illustrate a different upgrade path prior to depending on `com_google_protobuf` directly. ```diff diff --git i/bootcamp/WORKSPACE w/bootcamp/WORKSPACE index 3e7a614..0b13a55 100644 --- i/bootcamp/WORKSPACE +++ w/bootcamp/WORKSPACE @@ -24,15 +24,6 @@ load( rules_java_dependencies() rules_java_toolchains() -load( - "@rules_proto//proto:repositories.bzl", - "rules_proto_dependencies", - "rules_proto_toolchains", -) - -rules_proto_dependencies() -rules_proto_toolchains() - load("@com_frobozz_rules_magic//magic:config.bzl", "magic_config") magic_config( diff --git i/rules_magic/magic/deps.bzl w/rules_magic/magic/deps.bzl index 984e8ae..23b64af 100644 --- i/rules_magic/magic/deps.bzl +++ w/rules_magic/magic/deps.bzl @@ -15,11 +15,9 @@ def rules_magic_deps(): maybe( http_archive, - name = "rules_proto", - sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", - strip_prefix = "rules_proto-5.3.0-21.7", + name = "com_google_protobuf", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", + "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip", ], + sha256 = "5493a21f5ed3fc502e66fec6b9449c06a551ced63002fa48903c40dfa8de7a4a", ) ```
Adding a newer `rules_python` to `rules_magic_deps` _before_ `rules_proto` fixes the missing `rules_python` file error from the previous commit. rules_python 0.37.2 is the last version that doesn't pull in its own `protobuf`. `rules_python` 0.38.0 pulls in protobuf v27 unconditionally. 0.37.2 allows us to keep using rules_proto-5.3.0-21.7 for now. Also, `rules_python` 0.40.0 and later require newer `rules_cc` versions that may not play nice with `protobuf` v21.7. After we upgrade `protobuf` to a more recent version, we can upgrade to more recent `rules_python` version. For details: - bazel-contrib/rules_scala#1660 (comment) The build now produces the following failure: ```txt ERROR: external/remote_java_tools_darwin_arm64/BUILD: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD ERROR: external/rules_java_builtin/toolchains/BUILD:163:14: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD and referenced by '@@rules_java_builtin//toolchains:turbine_direct_graal_darwin_arm64' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Another `rules_java_builtin` and user-declared `rules_java` conflict due to the legacy `WORKSPACE` model: - `rules_java` 7.3.0 introduced the `turbine_direct_graal` target into its `//toolchains` package via: bazelbuild/rules_java#151: Use Turbine native image as `header_compiler_direct` bazelbuild/rules_java@d5b3ecf - As noted in "Bump to Bazel 7.6.2", the legacy `WORKSPACE` prefix creates `@rules_java_builtin`, which is actually `rules_java` 7.6.5. This version depends on `remote_java_tools` v13.6.1, whose repos contain `//:turbine_direct_graal`. Its `README.md` shows that it comes from bazelbuild/bazel@40ec2cd. https://github.com/bazelbuild/rules_java/blob/7.6.5/java/repositories.bzl#L25 https://github.com/bazelbuild/java_tools/releases/download/java_13.6.1/java_tools_darwin_arm64-v13.6.1.zip https://github.com/bazelbuild/bazel/blob/40ec2cd1a15d73473945475552ad1d0cb6d77927/tools/jdk/BUILD.java_tools_prebuilt#L26-L32 - The legacy `bootcamp/WORKSPACE` file invokes `rules_java_dependencies` from `rules_java` 6.5.2, instantiating `remote_java_tools` v12.6, whose repos do _not_ contain `//:turbine_direct_graal`. It comes from bazelbuild/bazel@bd91cb1. https://github.com/bazelbuild/rules_java/blob/6.5.2/java/repositories.bzl#L31 https://github.com/bazelbuild/java_tools/releases/download/java_v12.6/java_tools_darwin_arm64-v12.6.zip https://github.com/bazelbuild/bazel/blob/bd91cb131785a6693d45c7840a229d345e48d40b/tools/jdk/BUILD.java_tools_prebuilt - The legacy `WORKSPACE` suffix invokes `rules_java_dependencies` from `rules_java` 7.6.5. Since it wraps the `http_archive` repo rules instantiating `remote_java_tools` repos with `maybe`, nothing happens, because the repos already exist. - The legacy `WORKSPACE` suffix then invokes `rules_java_toolchains` from `rules_java` 7.6.5, which registers `//toolchains:all`. - That version of the `//toolchains` package aliases `"turbine_direct_graal_%s" % OS` to `"@remote_java_tools_%s//:turbine_direct_graal" % OS`. https://github.com/bazelbuild/rules_java/blob/7.6.5/toolchains/BUILD#L163-L166 - Since the `"@remote_java_tools_%s" % OS` repo doesn't contain a `turbine_direct_graal` target, analysis of `//toolchains:all` breaks. --- Another solution would've been to remove `rules_proto` as a dependency and to rely directly upon `com_google_protobuf`. However, we'll keep `rules_proto` for now to illustrate a different upgrade path prior to depending on `com_google_protobuf` directly.
Adding a newer `rules_python` to `rules_magic_deps` _before_ `rules_proto` fixes the missing `rules_python` file error from the previous commit. rules_python 0.37.2 is the last version that doesn't pull in its own `protobuf`. `rules_python` 0.38.0 pulls in protobuf v27 unconditionally. 0.37.2 allows us to keep using rules_proto-5.3.0-21.7 for now. Also, `rules_python` 0.40.0 and later require newer `rules_cc` versions that may not play nice with `protobuf` v21.7. After we upgrade `protobuf` to a more recent version, we can upgrade to more recent `rules_python` version. For details: - bazel-contrib/rules_scala#1660 (comment) The build now produces the following failure: ```txt ERROR: external/remote_java_tools_darwin_arm64/BUILD: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD ERROR: external/rules_java_builtin/toolchains/BUILD:163:14: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD and referenced by '@@rules_java_builtin//toolchains:turbine_direct_graal_darwin_arm64' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Another `rules_java_builtin` and user-declared `rules_java` conflict due to the legacy `WORKSPACE` model: - `rules_java` 7.3.0 introduced the `turbine_direct_graal` target into its `//toolchains` package via: bazelbuild/rules_java#151: Use Turbine native image as `header_compiler_direct` bazelbuild/rules_java@d5b3ecf - As noted in "Bump to Bazel 7.7.0", the legacy `WORKSPACE` prefix creates `@rules_java_builtin`, which is actually `rules_java` 7.6.5. This version depends on `remote_java_tools` v13.6.1, whose repos contain `//:turbine_direct_graal`. Its `README.md` shows that it comes from bazelbuild/bazel@40ec2cd. https://github.com/bazelbuild/rules_java/blob/7.6.5/java/repositories.bzl#L25 https://github.com/bazelbuild/java_tools/releases/download/java_13.6.1/java_tools_darwin_arm64-v13.6.1.zip https://github.com/bazelbuild/bazel/blob/40ec2cd1a15d73473945475552ad1d0cb6d77927/tools/jdk/BUILD.java_tools_prebuilt#L26-L32 - The legacy `bootcamp/WORKSPACE` file invokes `rules_java_dependencies` from `rules_java` 6.5.2, instantiating `remote_java_tools` v12.6, whose repos do _not_ contain `//:turbine_direct_graal`. It comes from bazelbuild/bazel@bd91cb1. https://github.com/bazelbuild/rules_java/blob/6.5.2/java/repositories.bzl#L31 https://github.com/bazelbuild/java_tools/releases/download/java_v12.6/java_tools_darwin_arm64-v12.6.zip https://github.com/bazelbuild/bazel/blob/bd91cb131785a6693d45c7840a229d345e48d40b/tools/jdk/BUILD.java_tools_prebuilt - The legacy `WORKSPACE` suffix invokes `rules_java_dependencies` from `rules_java` 7.6.5. Since it wraps the `http_archive` repo rules instantiating `remote_java_tools` repos with `maybe`, nothing happens, because the repos already exist. - The legacy `WORKSPACE` suffix then invokes `rules_java_toolchains` from `rules_java` 7.6.5, which registers `//toolchains:all`. - That version of the `//toolchains` package aliases `"turbine_direct_graal_%s" % OS` to `"@remote_java_tools_%s//:turbine_direct_graal" % OS`. https://github.com/bazelbuild/rules_java/blob/7.6.5/toolchains/BUILD#L163-L166 - Since the `"@remote_java_tools_%s" % OS` repo doesn't contain a `turbine_direct_graal` target, analysis of `//toolchains:all` breaks. --- Another solution would've been to remove `rules_proto` as a dependency and to rely directly upon `com_google_protobuf`. However, we'll keep `rules_proto` for now to illustrate a different upgrade path prior to depending on `com_google_protobuf` directly.
Adding a newer `rules_python` to `rules_magic_deps` _before_ `rules_proto` fixes the missing `rules_python` file error from the previous commit. rules_python 0.37.2 is the last version that doesn't pull in its own `protobuf`. `rules_python` 0.38.0 pulls in protobuf v27 unconditionally. 0.37.2 allows us to keep using rules_proto-5.3.0-21.7 for now. Also, `rules_python` 0.40.0 and later require newer `rules_cc` versions that may not play nice with `protobuf` v21.7. After we upgrade `protobuf` to a more recent version, we can upgrade to more recent `rules_python` version. For details: - bazel-contrib/rules_scala#1660 (comment) The build now produces the following failure: ```txt ERROR: external/remote_java_tools_darwin_arm64/BUILD: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD ERROR: external/rules_java_builtin/toolchains/BUILD:163:14: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD and referenced by '@@rules_java_builtin//toolchains:turbine_direct_graal_darwin_arm64' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Another `rules_java_builtin` and user-declared `rules_java` conflict due to the legacy `WORKSPACE` model: - `rules_java` 7.3.0 introduced the `turbine_direct_graal` target into its `//toolchains` package via: bazelbuild/rules_java#151: Use Turbine native image as `header_compiler_direct` bazelbuild/rules_java@d5b3ecf - As noted in "Bump to Bazel 7.7.0", the legacy `WORKSPACE` prefix creates `@rules_java_builtin`, which is actually `rules_java` 7.6.5. This version depends on `remote_java_tools` v13.6.1, whose repos contain `//:turbine_direct_graal`. Its `README.md` shows that it comes from bazelbuild/bazel@40ec2cd. https://github.com/bazelbuild/rules_java/blob/7.6.5/java/repositories.bzl#L25 https://github.com/bazelbuild/java_tools/releases/download/java_13.6.1/java_tools_darwin_arm64-v13.6.1.zip https://github.com/bazelbuild/bazel/blob/40ec2cd1a15d73473945475552ad1d0cb6d77927/tools/jdk/BUILD.java_tools_prebuilt#L26-L32 - The legacy `bootcamp/WORKSPACE` file invokes `rules_java_dependencies` from `rules_java` 6.5.2, instantiating `remote_java_tools` v12.6, whose repos do _not_ contain `//:turbine_direct_graal`. It comes from bazelbuild/bazel@bd91cb1. https://github.com/bazelbuild/rules_java/blob/6.5.2/java/repositories.bzl#L31 https://github.com/bazelbuild/java_tools/releases/download/java_v12.6/java_tools_darwin_arm64-v12.6.zip https://github.com/bazelbuild/bazel/blob/bd91cb131785a6693d45c7840a229d345e48d40b/tools/jdk/BUILD.java_tools_prebuilt - The legacy `WORKSPACE` suffix invokes `rules_java_dependencies` from `rules_java` 7.6.5. Since it wraps the `http_archive` repo rules instantiating `remote_java_tools` repos with `maybe`, nothing happens, because the repos already exist. - The legacy `WORKSPACE` suffix then invokes `rules_java_toolchains` from `rules_java` 7.6.5, which registers `//toolchains:all`. - That version of the `//toolchains` package aliases `"turbine_direct_graal_%s" % OS` to `"@remote_java_tools_%s//:turbine_direct_graal" % OS`. https://github.com/bazelbuild/rules_java/blob/7.6.5/toolchains/BUILD#L163-L166 - Since the `"@remote_java_tools_%s" % OS` repo doesn't contain a `turbine_direct_graal` target, analysis of `//toolchains:all` breaks. --- Another solution would've been to remove `rules_proto` as a dependency and to rely directly upon `com_google_protobuf`. However, we'll keep `rules_proto` for now to illustrate a different upgrade path prior to depending on `com_google_protobuf` directly.
Adding a newer `rules_python` to `rules_magic_deps` _before_ `rules_proto` fixes the missing `rules_python` file error from the previous commit. rules_python 0.37.2 is the last version that doesn't pull in its own `protobuf`. `rules_python` 0.38.0 pulls in protobuf v27 unconditionally. 0.37.2 allows us to keep using rules_proto-5.3.0-21.7 for now. Also, `rules_python` 0.40.0 and later require newer `rules_cc` versions that may not play nice with `protobuf` v21.7. After we upgrade `protobuf` to a more recent version, we can upgrade to more recent `rules_python` version. For details: - bazel-contrib/rules_scala#1660 (comment) The build now produces the following failure: ```txt ERROR: external/remote_java_tools_darwin_arm64/BUILD: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD ERROR: external/rules_java_builtin/toolchains/BUILD:163:14: no such target '@@remote_java_tools_darwin_arm64//:turbine_direct_graal': target 'turbine_direct_graal' not declared in package '' defined by external/remote_java_tools_darwin_arm64/BUILD and referenced by '@@rules_java_builtin//toolchains:turbine_direct_graal_darwin_arm64' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Another `rules_java_builtin` and user-declared `rules_java` conflict due to the legacy `WORKSPACE` model: - `rules_java` 7.3.0 introduced the `turbine_direct_graal` target into its `//toolchains` package via: bazelbuild/rules_java#151: Use Turbine native image as `header_compiler_direct` bazelbuild/rules_java@d5b3ecf - As noted in "Bump to Bazel 7.7.0", the legacy `WORKSPACE` prefix creates `@rules_java_builtin`, which is actually `rules_java` 7.6.5. This version depends on `remote_java_tools` v13.6.1, whose repos contain `//:turbine_direct_graal`. Its `README.md` shows that it comes from bazelbuild/bazel@40ec2cd. https://github.com/bazelbuild/rules_java/blob/7.6.5/java/repositories.bzl#L25 https://github.com/bazelbuild/java_tools/releases/download/java_13.6.1/java_tools_darwin_arm64-v13.6.1.zip https://github.com/bazelbuild/bazel/blob/40ec2cd1a15d73473945475552ad1d0cb6d77927/tools/jdk/BUILD.java_tools_prebuilt#L26-L32 - The legacy `bootcamp/WORKSPACE` file invokes `rules_java_dependencies` from `rules_java` 6.5.2, instantiating `remote_java_tools` v12.6, whose repos do _not_ contain `//:turbine_direct_graal`. It comes from bazelbuild/bazel@bd91cb1. https://github.com/bazelbuild/rules_java/blob/6.5.2/java/repositories.bzl#L31 https://github.com/bazelbuild/java_tools/releases/download/java_v12.6/java_tools_darwin_arm64-v12.6.zip https://github.com/bazelbuild/bazel/blob/bd91cb131785a6693d45c7840a229d345e48d40b/tools/jdk/BUILD.java_tools_prebuilt - The legacy `WORKSPACE` suffix invokes `rules_java_dependencies` from `rules_java` 7.6.5. Since it wraps the `http_archive` repo rules instantiating `remote_java_tools` repos with `maybe`, nothing happens, because the repos already exist. - The legacy `WORKSPACE` suffix then invokes `rules_java_toolchains` from `rules_java` 7.6.5, which registers `//toolchains:all`. - That version of the `//toolchains` package aliases `"turbine_direct_graal_%s" % OS` to `"@remote_java_tools_%s//:turbine_direct_graal" % OS`. https://github.com/bazelbuild/rules_java/blob/7.6.5/toolchains/BUILD#L163-L166 - Since the `"@remote_java_tools_%s" % OS` repo doesn't contain a `turbine_direct_graal` target, analysis of `//toolchains:all` breaks. --- Another solution would've been to remove `rules_proto` as a dependency and to rely directly upon `com_google_protobuf`. However, we'll keep `rules_proto` for now to illustrate a different upgrade path prior to depending on `com_google_protobuf` directly.
No description provided.