Skip to content
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

Turbine Exception in 5.x versions #1013

Closed
tferi opened this issue Dec 17, 2023 · 9 comments
Closed

Turbine Exception in 5.x versions #1013

tferi opened this issue Dec 17, 2023 · 9 comments
Milestone

Comments

@tferi
Copy link

tferi commented Dec 17, 2023

/external/rules_jvm_external/private/tools/java/com/github/bazelbuild/rules_jvm_external/BUILD:1:13: Compiling Java headers external/rules_jvm_external/private/tools/java/com/github/bazelbuild/rules_jvm_external/librules_jvm_external-hjar.jar (4 source files) [for tool] failed: (Exit 1): turbine_direct_graal failed: error executing command (from target @rules_jvm_external//private/tools/java/com/github/bazelbuild/rules_jvm_external:rules_jvm_external) external/remote_java_tools_darwin_arm64/java_tools/turbine_direct_graal --output ... (remaining 32 arguments skipped)

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.base@20.0.2/java.util.Objects.requireNonNull(Objects.java:259)
        at com.google.turbine.binder.CtSymClassBinder.bind(CtSymClassBinder.java:55)
        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)

This is present on all current 5.x versions (tested up to 5.3) on Bazel 6.4.0, Mac OS 13.5 (Darwin Kernel Version 22.6.0), remotejdk 17.

The error consistently does not occur on 4.5.

The error is misleading, as it is actually the java.home system property that's checked in the code, not the $JAVA_HOME environment variable, so it cannot be worked around with the (host_)?action_env flags.

@lperron
Copy link

lperron commented Dec 29, 2023

Same for me.

@cristifalcas
Copy link

same here

@ar3s3ru
Copy link

ar3s3ru commented Jan 4, 2024

I'm only getting this issue when updating rules_java from 7.1.0 to 7.3.1.
With rules_java=7.1.0 I'm able to run rules_jvm_external=5.3.

On Bazel 6.4.0, using Bzlmod.

@shs96c shs96c added this to the Release 6.0 milestone Jan 4, 2024
@shs96c
Copy link
Collaborator

shs96c commented Jan 4, 2024

How do I replicate this issue? Within the repo, I've updated example/bzlmod/MODULE.bazel to use rules_java version 7.3.1, and I'm not seeing the problem.

@lperron
Copy link

lperron commented Jan 5, 2024

For or-tools, just check out the main branch, and run bazel -c opt test ortools/...
It fails on my mac M1. I have bazel 6.4.0 homebrew.

@SanjayVas
Copy link

SanjayVas commented Jan 9, 2024

I believe the issue is specifically with rules_java > 7.2.0 and Bazel < 7. See bazelbuild/rules_java#159

@lperron
Copy link

lperron commented Jan 10, 2024

indeed, bazel7 works fine on a legacy WORKSPACE without bzlmod.
The issue is that brew has not updated past 6.4.0. I just switched to bazelisk.

@fmeum
Copy link
Contributor

fmeum commented Jan 15, 2024

Sorry for this. rules_java > 7.2.0 doesn't officially support Bazel 6. There shouldn't be a need to update past this version.

@shs96c
Copy link
Collaborator

shs96c commented Jan 15, 2024

It appears this is an issue with Turbine, which is part of Bazel itself. In addition, the problem only occurs when using rules_java with a version of bazel it's not designed to be used with. Because of both of these things, I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants