Building any plugin with bazel fails always with java.lang.IllegalArgumentException: external/local_jdk

91 views
Skip to first unread message

Sharath Gupta

unread,
Apr 7, 2020, 4:17:53 PM4/7/20
to Repo and Gerrit Discussion
I am trying to build plugins for Gerrit 2.16 and I see the below error everytime. Can someone please help? I am running it with Java 8.

$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

$ ls -la /etc/alternatives/java
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

gerrit$ bazel build plugins/changemessage
WARNING: Output base '/homes/spsgupta/.cache/bazel/_bazel_spsgupta/62bf4779654d000114c7917c8a51ecca' is on NFS. This may lead to surprising failures and undetermined behavior.
INFO: Invocation ID: 3f6cc866-a619-4a45-812f-6e6550a0df81
INFO: Analyzed target //plugins/changemessage:changemessage (1 packages loaded, 12 targets configured).
INFO: Found 1 target...
ERROR: /homes/spsgupta/.cache/bazel/_bazel_spsgupta/62bf4779654d000114c7917c8a51ecca/external/bazel_tools/tools/jdk/BUILD:309:1: Action external/bazel_tools/tools/jdk/platformclasspath.jar failed (Exit 1) java failed: error executing command external/remotejdk11_linux/bin/java -XX:+IgnoreUnrecognizedVMOptions '--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED' -cp ... (remaining 4 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Exception in thread "main" java.lang.IllegalArgumentException: external/local_jdk
at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.update(Locations.java:1853)
at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.handleOption(Locations.java:1798)
at jdk.compiler/com.sun.tools.javac.file.Locations.handleOption(Locations.java:2062)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:269)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager$2.handleFileManagerOption(BaseFileManager.java:222)
at jdk.compiler/com.sun.tools.javac.main.Option.process(Option.java:1138)
at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Option.java:1086)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:232)
at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:390)
at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:347)
at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:246)
at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:185)
at DumpPlatformClassPath.dumpJDK9AndNewerBootClassPath(DumpPlatformClassPath.java:106)
at DumpPlatformClassPath.main(DumpPlatformClassPath.java:67)
Target //plugins/changemessage:changemessage failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.464s, Critical Path: 0.92s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

David Ostrovsky

unread,
Apr 8, 2020, 3:09:44 PM4/8/20
to Repo and Gerrit Discussion

Am Dienstag, 7. April 2020 22:17:53 UTC+2 schrieb Sharath Gupta:
I am trying to build plugins for Gerrit 2.16 and I see the below error everytime. Can someone please help? I am running it with Java 8.

$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

$ ls -la /etc/alternatives/java
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

gerrit$ bazel build plugins/changemessage
WARNING: Output base '/homes/spsgupta/.cache/bazel/_bazel_spsgupta/62bf4779654d000114c7917c8a51ecca' is on NFS. This may lead to surprising failures and undetermined behavior.
INFO: Invocation ID: 3f6cc866-a619-4a45-812f-6e6550a0df81
INFO: Analyzed target //plugins/changemessage:changemessage (1 packages loaded, 12 targets configured).
INFO: Found 1 target...
ERROR: /homes/spsgupta/.cache/bazel/_bazel_spsgupta/62bf4779654d000114c7917c8a51ecca/external/bazel_tools/tools/jdk/BUILD:309:1: Action external/bazel_tools/tools/jdk/platformclasspath.jar failed (Exit 1) java failed: error executing command external/remotejdk11_linux/bin/java -XX:+IgnoreUnrecognizedVMOptions '--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED' -cp ... (remaining 4 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Exception in thread "main" java.lang.IllegalArgumentException: external/local_jdk

What Bazel version are you using? A similar issue was reported last
year: [1]. Can you try to build with Bazel 3.0.0 from this commit: [2]?
How JAVA_HOME variable is defined in your environment?




Sharath Gupta

unread,
Apr 9, 2020, 2:00:09 PM4/9/20
to David Ostrovsky, Repo and Gerrit Discussion
I was running with Bazel 1.2.0. It seem to be working after I rebased the source code and upgraded Bazel to 3.0.0. Thanks for the suggestions.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/0gsQKyZfEYU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/0b52bafe-4f73-42e4-9c6f-0ba75e77c45f%40googlegroups.com.


--
-Sharath P S
Believe you can and you're halfway there.
Reply all
Reply to author
Forward
0 new messages