-
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
Clarify macOS installation instructions and de-duplicate homebrew formulas #11243
Comments
Homebrew by policy doesn't allow pre-built binary blobs in their core tap (similar to Debian and other distros with a strongly free/libre philosophy). This means building Bazel from source, which means a build-time dependency on Python and a build- and run-time dependency on some version of the JDK. Therefore, I think the best fix we could do would be along the following lines:
|
Blocked by #11399 |
First of all, upstream, we build and test offical Bazel macOS binary packages with JDK 11; the choice of JDKs is an unnecessary difference between the homebrew-core formula (which builds Bazel from source) and the bazelbuild tap formula (which installs the upstream binary package). Second, it's fragile to depend on the OS-provided install of JDK 1.8: users may (and do) uninstall the obsolete JDK, inadvertently breaking their Bazel builds. See discussion linked from bazelbuild/bazel#11243. Finally, it should be noted that using JDK 11 brings performance improvements when using Bazel to build large projects. Simplify the bootstrapping invocation by following the instructions at https://docs.bazel.build/versions/master/install-compile-source.html Note that JAVA_PATH must point to openjdk's Contents/Home, otherwise bazel will fail to find the JNI headers: bazelbuild/bazel#11399
Sent a PR to homebrew-core: Homebrew/homebrew-core#54712 |
First of all, upstream, we build and test offical Bazel macOS binary packages with JDK 11; the choice of JDKs is an unnecessary difference between the homebrew-core formula (which builds Bazel from source) and the bazelbuild tap formula (which installs the upstream binary package). Second, it's fragile to depend on the OS-provided install of JDK 1.8: users may (and do) uninstall the obsolete JDK, inadvertently breaking their Bazel builds. See discussion linked from bazelbuild/bazel#11243. Finally, it should be noted that using JDK 11 brings performance improvements when using Bazel to build large projects. Simplify the bootstrapping invocation by following the instructions at https://docs.bazel.build/versions/master/install-compile-source.html Note that JAVA_PATH must point to openjdk's Contents/Home, otherwise bazel will fail to find the JNI headers: bazelbuild/bazel#11399 Closes #54712. Signed-off-by: chenrui <[email protected]>
First of all, clarify the situation with the two Homebrew packages. The default homebrew/core formula is community-maintained and builds from source; the Homebrew project does not install upstream binaries as a matter of policy: https://github.com/Homebrew/brew/blob/master/docs/Acceptable-Formulae.md#we-dont-like-binary-formulae Meanwhile, the `bazelbuild` tap is maintained by us and installs our official macOS binary package. Users may choose either (depending on their personal philosophy about building from source vs. using official binaries), but we encourage the `bazelbuild` option, since we can better control that it delivers a good experience. Second, remove the Bazelisk paragraph (duplicated in install-bazelisk.md) Addresses part of #11243. RELNOTES: None. PiperOrigin-RevId: 311763252
Thank you so much @tetromino! |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
There exist two Homebrew formulas for Bazel:
Default tap: https://github.com/Homebrew/homebrew-core/blob/master/Formula/bazel.rb
bazelbuild tap: https://github.com/bazelbuild/homebrew-tap/blob/master/Formula/bazel.rb
Note that the default formula has a dependency on Python 3.8 and Java 1.8:
https://github.com/Homebrew/homebrew-core/blob/ac3ab999a2be2871e256819138a0fabb8f1c6787/Formula/bazel.rb#L14-L16
whereas the bazelbuild tap does not depend on Java nor Python (which makes sense, given that we have an embedded JDK to run Bazel, and bring in a remote JDK to run Java tools).
Our official macOS instructions recommend using the bazelbuild tap. But given that most macOS Homebrew users would instinctively type "brew install bazel" without reading the installation instructions, they would end up using the default tap, bringing a system dependency on Java 8 and Python, and not using the brew tap the Bazel team maintains at all.
Quote from a user: "I never actually read (the installation instructions). When I needed Bazel I just did brew install bazel (because that's how 98% of things work) and it worked.. until I updated Java and formula broke."
Can we merge the bazelbuild tap into the default tap, and drop the dependency on Java 1.8? That'll allow us to stop maintaining a custom tap during the release process as well, and actually release Bazel on the "blessed" path.
The text was updated successfully, but these errors were encountered: