-
Notifications
You must be signed in to change notification settings - Fork 4k
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
android_library builds java_library deps with as Java 1.9 since Bazel 0.16 #5978
Comments
Probably because this doesn't check for Java 1.9 https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidSemantics.java#L46 |
This also results in the following Bazel warnings when building:
|
Does this reproduce with 0.17 or Bazel at head? This might be the same issue as #5888. |
I can reproduce this problem with building an Android app and RBE, with the following bazelrc config: |
@jin which Bazel version you reproduce with? Are you seeing with issue with the 0.17rc and at head, or just at 0.16.1? |
Just 0.17.1rc1 and HEAD. 0.16.1 is fine. |
I think this is still #5888, and the issue is that when Bazel is built at HEAD or 0.17rc using 0.16.1, 0.16.1 produces a Bazel binary that contains the linkage issue. If I build Bazel at head and then re-build using the HEAD binary (i.e. |
@jin I have modified the release pipeline accordingly now. However, it's worrying that this regression wasn't caught by our integration tests on CI (if I understand correctly). In theory, the commit that caused Bazel 0.16.1 to produce broken binaries should not have been able to be committed, because presubmit tests should have caught it, right? How can we prevent this in the future? |
This was only caught when using a custom JDK8 toolchain for RBE to build an Android app. The incompatible code path was in the Android build logic.
Perhaps we can build //examples/... in the RBE pipeline?
… On Aug 27, 2018, at 7:31 AM, Philipp Wollermann ***@***.***> wrote:
@jin I have modified the release pipeline accordingly now.
However, it's worrying that this regression wasn't caught by our integration tests on CI (if I understand correctly). In theory, the commit that caused Bazel 0.16.1 to produce broken binaries should not have been able to be committed, because presubmit tests should have caught it, right?
How can we prevent this in the future?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Catching up with the issue, it's great you guys found the issue! |
I don't know - can we? :D From a config perspective, we just have to add it here: https://github.com/bazelbuild/bazel/blob/master/.bazelci/presubmit.yml#L120 Can you try if it works and send me a CL with the changes? |
Opened #6007 |
Please let me know if there's a cherrypick to do in Bazel release. |
I don’t think there is one, we just needed a release pipeline update (thanks @philwo!).
We can close this issue after verifying that the new RC fixes it.
… On Aug 28, 2018, at 8:56 AM, Laurent Le Brun ***@***.***> wrote:
Please let me know if there's a cherrypick to do in Bazel release.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I can verify that building the latest bazel with the latest rc (0.17.1rc1) fixes this issue. @steeve, please reopen if you are still running into this issue. |
Hey guys, sorry I report I'm still running into this issue with 0.17.1 (sorry I couldn't test earlier). However this time the bazelrc workaround doesn't work:
|
@steeve can you provide steps for reproducing the problem you're seeing? |
@cushon I put together a repro repo for both scenarios: https://github.com/steeve/bazel_issue_5978 |
Thanks! Without forcing JDK8 it "works", but:
Ultimately this won't work because Android doesn't support JDK >8. I'm think we might want to keep this issue open, wether it's in the form of documentation (to tell people to force using jdk8) or fixing it altogether. |
See #6151 See also #5978 (comment). PiperOrigin-RevId: 213216870
Description of the problem / feature request:
When building an
android_library
, Bazel buildsjava_library
deps as Java 1.9 since it went to the JDK9.This results in the following proguard issues when building downstream, for instance with Protobuf Javalite:
The issue is fixed by manually reverting to JDK8 with the following options:
Android does not support
java.nio
nor JDK9 yet.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Build an Android app with proguard and Protobuf Javalite.
What operating system are you running Bazel on?
OSX
What's the output of
bazel info release
?Have you found anything relevant by searching the web?
I found an issue that said to manually add
--javacopts="-source 8 -target 8"
. Not sure this is the recommended way until Bazel does it itself ?Thanks!
The text was updated successfully, but these errors were encountered: