-
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 0.16: Unrecognized VM Option "CompactStrings" #5726
Comments
Hi, we changed the default toolchain to JDK9. If you would like to use JDK8, you can specify the JDK8 toolchain by adding |
Thank you for the guidance. How would I use the embedded JDK instead? |
The embedded JDK is the default server and host javabase. Are you passing any javabase flags to the build? And do you have a self-contained example that reproduces the issue you're seeing? |
@robfig the embedded jdk should be the default. I assumed you were overwriting the embedded with your own? |
I'm not intentionally overriding it, no. We use no-argument "bazel build" and "bazel test" commands. There's nothing relevant in our WORKSPACE afaik, but here's our bazel.rc: Example target
Without that
Passing -s shows that it's using local_jdk This is a proprietary codebase, so I'm afraid I can't share it. Any ideas? |
We discovered that it's this flag
Setting that back to |
Ah, that makes sense. There's another bug for that: #5572 |
Can you confirm the recommended next steps? I see these options for us:
Thanks @cushon! |
cc @buchgr I tentatively think some of this is going to be fixed by a point release together with #5744 and #5594. JDK 8 is not going to be supported as a host_javabase for that much longer, though, at which point using |
I tried out 0.16.1, but ran into issues with both jdk9 and jdk8. With these flags
My understanding is that those flags should use my workstation's JDK, but I get this error for our crypto package, which seems to say it's using java 9 for compiling, and not including jce.jar on the bootclasspath.
Trying to use the embedded JDK, with these flags
Returns a bug that looks like an issue with JDK9, but not JDK8 or JDK10. I guess I can write a program to scan all our jars to find which one the issue resides in and repackage it, then perhaps this approach will work. https://bugs.java.com/view_bug.do?bug_id=8194730
As an aside, the naming of tools/jdk:host_jdk vs tools/jdk:jdk seems backwards from what I would expect. host_jdk seems to refer to the embedded jdk, rather than the one installed on the host. Thinking I might be wrong on that point, I tried this combination, with the associated error:
I'll continue working on getting our codebase buildable with JDK9. Thanks |
|
Ah, thanks for the explanation. That combination still leads to an error with JAVA_HOME:
I get the same error when running with a defined java_runtime:
|
That's because this line:
should include all of: I fixed this in #5894 (which mostly fixes #5888), but I'll leave this bug open until this part of the issue is resolved on way or another. |
We are still waiting for 0.16.2 which will include the platform classpath fix to upgrade.. is there any place I can track it to verify that it will include the fix or see the progress it's making for planning purposes? Thanks! |
Summary: Bazel 0.20.0 introduced some incompatible changes that broke both our code and our dependencies. Our dependencies also introduced some incompatible changes of their own. This commit upgrades our dependencies and fixes up our code to accommodate them. An upgrade to transitive dependency `rules_go` introduces a dependency on the `@bazel_tools//tools/build_defs/cc:action_names.bzl` builtin target. This target was only introduced in Bazel 0.16.0, so as a consequence our workspace is no longer compatible with earlier versions of Bazel. In practice, we must use at least version 0.16.1 to fix a regression in 0.16.0: <bazelbuild/bazel#5726>. Unfortunately, Bazel 0.16.0 also introduced a regression that prevents us from using the `--distinct_host_configuration=false` option; this has not been fixed as of Bazel 0.20.0. As a result, parts of our build will now be twice as slow. The new `urllib3` dependency is due to a transitive Selenium upgrade. This commit shifts our Bazel version window from [0.13.0, 0.19.2] to [0.16.1, 0.20.0]. Test Plan: Running `bazel test //tensorboard/...` passes in Python 2 and 3 in Bazel versions 0.16.1 and 0.20.0 (latest at time of writing), with the `.bazelrc` file set up as on Travis: ```sh >~/.bazelrc echo "startup --output_base=${HOME}/.bazel-output-base" >>~/.bazelrc echo "startup --host_jvm_args=-Xms500m" >>~/.bazelrc echo "startup --host_jvm_args=-Xmx500m" >>~/.bazelrc echo "startup --host_jvm_args=-XX:-UseParallelGC" >>~/.bazelrc echo "build --local_resources=400,2,1.0" >>~/.bazelrc echo "build --worker_max_instances=2" >>~/.bazelrc echo "build --worker_verbose" >>~/.bazelrc echo "build --worker_sandboxing" >>~/.bazelrc echo "build --spawn_strategy=sandboxed" >>~/.bazelrc echo "build --genrule_strategy=sandboxed" >>~/.bazelrc echo "test --test_verbose_timeout_warnings" >>~/.bazelrc echo "build --verbose_failures" >>~/.bazelrc echo "test --test_output=errors" >>~/.bazelrc ``` wchargin-branch: bazel-0.20.0-fixes
Description of the problem / feature request:
Upgrading from 0.15 to 0.16 results in this error when building any java_library
Re-running the command shows me a similar error message, this time including the command
I believe this happens because my system Java is JDK8, and Bazel is using it by default (the local_jdk reference). However, it is passing a parameter only understood by Java 9.
This appears to have been added by this commit, by @buchgr :
3842bd3
Is it expected that bazel no longer works on systems with JDK 8 installed? Is there a way to cause bazel to use the embedded JDK and do you recommend that (or are there other downsides)?
Thank you,
Rob
What operating system are you running Bazel on?
Mac OS High Sierra
What's the output of
bazel info release
?release 0.16.0
Have you found anything relevant by searching the web?
I haven't found any other reports of this.
The text was updated successfully, but these errors were encountered: