Bazel in Homebrew Cask

135 views
Skip to first unread message

Jakob Buchgraber

unread,
Aug 14, 2018, 12:24:46 PM8/14/18
to bazel-discuss
TL;DR; If you use Bazel on macOS you will have to type brew cask install bazel instead of brew install bazel.

Hi all,

we are in the process of making all Bazel releases use an embedded JDK to run Bazel itself. As of 0.16.0
all supported Bazel releases contain an embedded JDK. An embedded JDK allows us to exhaustively test
Bazel itself on a specific JDK version and removes the need for users who don't use Bazel to build Java
to install their own JDK.

Bazel is currently in homebrew core which does not allow one to include binaries in a formula but instead
requires all binaries to be built from source. This policy is not compatible with embedding a JDK and so
we are planning to move out of homebrew core and into homebrew cask. Homebrew cask extends
homebrew core by allowing formulas to include pre-built binaries.

The only user facing changes will be that for installing Bazel using the brew command one will have to
type

$ brew cask install bazel

instead of currently

$ brew install bazel

I am planning on making this change starting with the just released Bazel 0.16.1. I would be interested to learn
about any of your concerns and feedback in general.

Thanks,
Jakob

Jakob Buchgraber

Software Engineer


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.


Gregg Donovan

unread,
Aug 14, 2018, 7:14:34 PM8/14/18
to bazel-discuss
We use the homebrew install for macOS and using cask install is not a problem for us. We're happy to not worry about any interactions between the JDK used by Bazel and the JDK we install on macOS for compiling and running Java/Scala code. The macOS install is the only open issue we're waiting for to get started on 0.16.1. Looking forward to it!

Our only feedback for the 0.16.x JDK changes is that the documentation on creating your own JDK toolchain should be a little more verbose. For the common cases -- e.g. using a released version of Oracle JDK 8 through 10 or OpenJDK 8 through 10 -- there should be some clearer examples for how to configure your own java toolchain. (Apologies if such docs exist and I've missed them.)

Jakob Buchgraber

unread,
Aug 16, 2018, 8:00:07 AM8/16/18
to bazel-discuss
Hi all,

after some discussions we believe that instead of adding Bazel to Homebrew Cask we should create our own
Homebrew Tap under https://github.com/bazelbuild/homebrew-tap (does not exist yet). Users will be able to
install Bazel by adding our tap

$ brew tap bazelbuild/tap
$ brew tap-pin bazelbuild/tap 

and doing the familiar

$ brew install bazel

The reasons we believe this to be the right approach is that we want to be able to automatically test and deploy
packages to a homebrew tap. We are currently hard at work to improve our release process and testing and
believe there is value in owning the whole process. Additionally, we are also considering providing formulaes for
previous Bazel versions, which is something we couldn't do in Cask. That being said, we don't rule out being
in Cask and it's possible that we'll have our own tap and a Cask in the future if there is interest in that. We would
certainly be supportive of any community effort in that direction!

Please let me know what you think!

Best,
Jakob

Jakob Buchgraber

Software Engineer


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.



Jakob Buchgraber

unread,
Aug 16, 2018, 8:01:32 AM8/16/18
to gdon...@etsy.com, bazel-discuss
On Wed, Aug 15, 2018 at 1:14 AM 'Gregg Donovan' via bazel-discuss <bazel-...@googlegroups.com> wrote:
Our only feedback for the 0.16.x JDK changes is that the documentation on creating your own JDK toolchain should be a little more verbose. For the common cases -- e.g. using a released version of Oracle JDK 8 through 10 or OpenJDK 8 through 10 -- there should be some clearer examples for how to configure your own java toolchain. (Apologies if such docs exist and I've missed them.)


Thanks for the feedback. I am currently working on a blog post detailing on how to do that and also announcing some
future changes to the JDK in Bazel.

Thanks,
Jakob
 
--
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/664c074a-d48d-402b-acc8-89ffd7a59f26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages