The state of 0.16 and 0.17 Bazel releases

168 views
Skip to first unread message

Dmitry Lomov

unread,
Aug 8, 2018, 8:05:17 AM8/8/18
to bazel-discuss
Hi Bazel folks,

Unfortunately Bazel release 0.16 has some issues. In this mail I summarize the issues and outline our current plan to deal with those, as well as the plans for 0.17 release. Some of this might changed based on results of some investigations we are doing now.

Bazel release 0.16 (https://github.com/bazelbuild/bazel/issues/5058) is the first release that embeds JDK 9. However Java rules as shipped with Bazel release 0.16 cannot build with JDK 9 (https://github.com/bazelbuild/bazel/issues/5744) - which means that this broke users who were previously able to build Java with Bazel without a separate JDK installed. 
Our longer-term goal is indeed to fully hide the embedded JDK - it should not matter which Java runtime Bazel itself runs on, and it will allow us to drastically reduce the binary size of Bazel - but the change in 0.16 was unintentional and disrupted many users.

Therefore we will be issuing a patch release 0.16.1 (https://github.com/bazelbuild/bazel/issues/5792) in which we either
 * revert the embedded JDK to JDK 8, or
 * make sure that Java rules can target JDK 9
Currently the first of these alternatives seem more viable, but follow https://github.com/bazelbuild/bazel/issues/5792.
(there also seem to be a flaky crash on Windows related to JDK 9 that we are currently investigating: https://github.com/bazelbuild/bazel/issues/5730)

Going forward, a couple of things is clear:
- we do not test this scenario adequately
- we need to make sure that 0.17 and further releases do not regress this again.

Therefore, we will abandon the currently cut 0.17 (https://github.com/bazelbuild/bazel/issues/5059).
We will recut it again when we can build Java with embedded JDK and when we put adequate testing for that scenario in place.
Our current plan is that 0.17 will embed JDK 9 (or even 10) and Java rules will be able to target any of JDKs 8-10.
Follow the relevant GH issues for updates on this. 

As I said above, the longer term plan is to disallow the usage of embedded JDK for development, but that will come in a controlled way with a proper announcement at a later time.

On behalf of Bazel team, I apologize for the inconvenience this have caused. We are working on getting this fixed ASAP and to ensure we prevent such regressions in the future.

Dmitry
-- 
Google Germany GmbH
Erika-Mann-Straße 33, 80636 München, Germany

david.o...@gmail.com

unread,
Aug 9, 2018, 1:31:51 AM8/9/18
to bazel-discuss
On Wednesday, August 8, 2018 at 2:05:17 PM UTC+2, Dmitry Lomov wrote:
> Hi Bazel folks,
>
>
> Unfortunately Bazel release 0.16 has some issues. In this mail I summarize the issues and outline our current plan to deal with those, as well as the plans for 0.17 release. Some of this might changed based on results of some investigations we are doing now.
>
>
> Bazel release 0.16 (https://github.com/bazelbuild/bazel/issues/5058) is the first release that embeds JDK 9. However Java rules as shipped with Bazel release 0.16 cannot build with JDK 9 (https://github.com/bazelbuild/bazel/issues/5744) - which means that this broke users who were previously able to build Java with Bazel without a separate JDK installed.

Unfortunately embedded JDK9 switch in 0.16.0 Bazel release also
broke projects (most notably stable branch of Gerrit Code Review)
*with* a separate JDK8 installed: [1].

That's because the annotation processor machinery is using embedded
JDK and some outdated versions of processor libraries (e.g.: Dagger
and auto-value) are not JDK9 ready: [2], [3]. While we were able to
bump those versions on very stable gerrit branch and make Bazel 0.16.0
work there: [4],[5], what if we couldn't? That means, that we wouldn't
be able to build older Gerrit versions with newer Bazel versions. We
could handle this, of course, but we would need time to adapt our CI
toolchain to use older Bazel versions on older Gerrit branches. ATM
we use one single Bazel docker image to build gerrit master and all
stable branches.

[1] https://groups.google.com/d/topic/bazel-discuss/zODjrcJtk2E/discussion
[2] https://github.com/google/dagger/issues/880
[3] https://github.com/google/auto/issues/560
[4] https://gerrit-review.googlesource.com/c/gerrit/+/191186
[5] https://gerrit-review.googlesource.com/c/gerrit/+/191190


Dmitry Lomov

unread,
Aug 9, 2018, 5:42:37 AM8/9/18
to david.o...@gmail.com, Liam Miller-Cushon, bazel-discuss, Jakob Buchgraber, Irina Iancu, Christopher Parsons
Liam, will your fixes  to enable targeting JDK9 (for https://github.com/bazelbuild/bazel/issues/5744) address the annotation processor issues?
0.16.1rc1 (https://github.com/bazelbuild/bazel/issues/5792#issuecomment-411520607) takes the second approach ("make sure that Java rules can target JDK 9")

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c71f93e4-26d8-4c9f-9d32-dac3b4280b65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Liam Miller-Cushon

unread,
Aug 9, 2018, 12:54:43 PM8/9/18
to Dmitry Lomov, david.o...@gmail.com, bazel-discuss, Jakob Buchgraber, Irina Iancu, Christopher Parsons
On Thu, Aug 9, 2018 at 2:42 AM Dmitry Lomov <dsl...@google.com> wrote:
Liam, will your fixes  to enable targeting JDK9 (for https://github.com/bazelbuild/bazel/issues/5744) address the annotation processor issues?

No, the issues with annotations processors that were cited are problems with the annotations processors themselves, and the fix is to update to a recent version of the processors.

If that isn't feasible, setting --host_javabase to JDK 8 can be used as a work-around.

I don't have any suggestions for working around those issues in Bazel itself for 0.16.1, short of rolling back to pre-embedded JDK 9.
Reply all
Reply to author
Forward
0 new messages