-
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
distinct host configuration doesn't work for Java targets anymore #5572
Comments
On this PR there are even errors in the task before i enabled this flag, so there seems to be wider issues here with the JDK change |
looks like a configurability issue, cc @gregestren any ideas? |
I can reproduce this. Will try to diagnose cause tomorrow. Thanks for the report. |
When I repro with a trivial //java/com/domain/testapp:foo, my error is:
TypeElement comes from:
Curiously, there's no work being done in the host configuration for this build. However, when I run
vs.:
you see it's choosing a different jdk root. So Bazel is trying to build with the system's local JDK for This looks related to 849df36, which creates a distinction between the local vs. embedded JDK for different modes of building. One of Referring to @cushon, who should have more JDK-specific insight about the implications. |
As a side note, do you actually need |
The referenced change 849df36 is already in 0.15, so either there's already a regression in 0.15, or that's not the one. |
This is the outcome of the default RHS --host_javabase being JDK 9, and the default --javabase being JDK 8. Using a JDK 8 RHS --host_javabase should work around it, but that configuration won't be supported indefinitely. Using a JDK 9 --javabase would also resolve this, but that isn't supported yet. |
distinct_host_configuration i've used a few times with mixed success, we mostly have pure jvm repos, and some usage of scripts or other oddities has caused us to sometimes to build for both host and target which is a waste. So this was good to just enforce we don't do it twice. That said i don't need this option -- but if its broken we probably need to flag it as a breaking change/going away? The first failing commit on that PR branch happened before enabling the distinct host configuration too -- https://travis-ci.org/bazelbuild/rules_scala/jobs/402681221 |
I agree this is unfortunate. I think maybe Bazel team has some ideas about a more focused solution to this, but I'm not sure what the current status is. |
Please do not assign issues to more than one team. |
Any news on this? |
I don't think |
We are still using this in TF |
Did this regress recently for you? I think the issue that was originally reported was a different between JDK 8 and 9 in the host/target config, are you seeing something similar but with different Java versions? Also note that tensorflow/tensorflow#52598 is using |
We had a commit from @comius at tensorflow/toolchains#23 for his comment at #13241 (comment) But then we reverted with tensorflow/toolchains#25 as It was failing on MacOS. So when It was renabled to speedup the MacOS build It failed again: |
Closing this as |
Description of the problem / feature request:
Since the 0.16.0rc's it looks like the distinct_host_configuration=false flag is broken
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Enable the flag and no java targets will compile
What operating system are you running Bazel on?
Both os x and linux fail
What's the output of
bazel info release
?0.16.0rc3
Any other information, logs, or outputs that you want to share?
Per platform CI runs failing on travis via PR @ bazelbuild/rules_scala#556
The text was updated successfully, but these errors were encountered: