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

Cannot build src/tools/execlog:parser without local JDK #12012

Closed
MikhailTymchukFT opened this issue Aug 27, 2020 · 1 comment
Closed

Cannot build src/tools/execlog:parser without local JDK #12012

MikhailTymchukFT opened this issue Aug 27, 2020 · 1 comment
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website team-Rules-Java Issues for Java rules type: bug untriaged

Comments

@MikhailTymchukFT
Copy link

Description of the problem / feature request:

I'm comparing execution log of a build using this docs section.

When no local JDK is installed, the following error occurs when trying to build the parser:

$ bazel build src/tools/execlog:parser
DEBUG: /private/var/tmp/_bazel_mikhailtymchuk/05771ca1b5b45c3172231ec7845956af/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:9: rbe_ubuntu1804_java11 not using checked in configs as detect_java_home was set to True
DEBUG: /private/var/tmp/_bazel_mikhailtymchuk/05771ca1b5b45c3172231ec7845956af/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:9: rbe_ubuntu1604_java8 not using checked in configs as detect_java_home was set to True
INFO: Build option --macos_minimum_os has changed, discarding analysis cache.
INFO: Analyzed target //src/tools/execlog:parser (32 packages loaded, 1053 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_mikhailtymchuk/05771ca1b5b45c3172231ec7845956af/external/bazel_tools/tools/jdk/BUILD:314:1: Action external/bazel_tools/tools/jdk/platformclasspath.jar failed (Exit 1) java failed: error executing command external/remotejdk11_macos/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.isCurrentPlatform(Locations.java:1862)
	at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.update(Locations.java:1851)
	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)
Caused by: java.nio.file.NoSuchFileException: external/local_jdk
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.isSameFile(UnixFileSystemProvider.java:333)
	at java.base/java.nio.file.Files.isSameFile(Files.java:1530)
	at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.isCurrentPlatform(Locations.java:1860)
	... 14 more
Target //src/tools/execlog:parser failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 29.222s, Critical Path: 3.54s
INFO: 17 processes: 16 darwin-sandbox, 1 worker.
FAILED: Build did NOT complete successfully

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

$ git clone https://github.com/bazelbuild/bazel.git
$ cd bazel
$ bazel build src/tools/execlog:parser

What operating system are you running Bazel on?

MacOS 10.15.6

What's the output of bazel info release?

release 2.1.0

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

https://github.com/bazelbuild/bazel.git
18ee6ba
18ee6ba

Have you found anything relevant by searching the web?

This PR searches for local JDK which does not exist in my case: #7324
These 3 issues #7304, #7953 and google/j2cl#34 mention the same error.

Any other information, logs, or outputs that you want to share?

I still consider this a bug, because there is no info in bazel installation docs about the need of installing JDK: https://docs.bazel.build/versions/master/install-os-x.html
https://docs.bazel.build/versions/master/remote-execution-caching-debug.html does not mention this dependency either.

@oquenchil oquenchil added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug untriaged labels Aug 27, 2020
@comius comius added the team-Rules-Java Issues for Java rules label Sep 10, 2020
@comius
Copy link
Contributor

comius commented Sep 10, 2020

This is a duplicate of #6993.
It's true, bazel does not need installed JDK, however it defaults to it.
Workaround, add cmd line parameter: --javabase=@bazel_tools//tools/jdk:remote_jdk11

@comius comius closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website team-Rules-Java Issues for Java rules type: bug untriaged
Projects
None yet
Development

No branches or pull requests

3 participants