-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
bazel downloads the JDK during execution #6865
Comments
This is the actual error line we're getting:
|
This is intentional, we're not longer exposing the embedded JDK that we use to run bazel as host_jdk. You can explicitly set the |
0.21 removed the bundled openjdk-distribution. Instead, tries to fetch the “right” distribution on-the-fly when building. So we need to provide our own openjdk. According to bazelbuild/bazel#6865 (comment) we should set `--host_javabase="@local_jdk//:jdk` if we want to do that. This uses the jdk that is currently in the environment, which is openjdk 8 in our case. 0.21 defaulted to a toolchain for JDK9, which we don’t package in nixpkgs, so we use the JDK8 toolchain. This commit also replaces the line-number-based sed invocations with something more stable.
0.21 removed the bundled openjdk-distribution. Instead, tries to fetch the “right” distribution on-the-fly when building. So we need to provide our own openjdk. According to bazelbuild/bazel#6865 (comment) we should set `--host_javabase="@local_jdk//:jdk` if we want to do that. This uses the jdk that is currently in the environment, which is openjdk 8 in our case. 0.21 defaulted to a toolchain for JDK9, which we don’t package in nixpkgs, so we use the JDK8 toolchain. This commit also replaces the line-number-based sed invocations with something more stable.
I don't think --host_javabase exists anymore is there an alternative way to prevent jdk downloads given there is a jdk on the machine. |
@jeb2239 |
is this supposed to be a startup option? What should it be set too if I want to stop all downloads of jdks? I have JAVA_HOME set to my local java install. I have tried pointing --host_javabase to various things but I keep getting an option doesn't exist error. |
No it's not a startup option, see https://docs.bazel.build/versions/master/user-manual.html#flag--host_javabase.
|
I ran into the same problem and this runs just fine |
Description of the problem / feature request:
When running tests with bazel, it tries to download some JDK. This makes bazel dependent on connectivity in order to run. In our case, we do have connectivity to the internet, but if there are transitive errors when trying to download the JDK, the tests will fail. If there are no errors, it still adds extra time to the tests, which is not ideal.
Why is this needed? Can't bazel be completely hermetic and not require runtime downloads?
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://travis-ci.org/bazelbuild/rules_apple/jobs/464988085
What operating system are you running Bazel on?
macOS / Travis
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.Using bazel at "head" from the nightly releases.
The text was updated successfully, but these errors were encountered: