Skip to content
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

Closed
jin opened this issue Apr 29, 2020 · 6 comments
Closed

Clarify macOS installation instructions and de-duplicate homebrew formulas #11243

jin opened this issue Apr 29, 2020 · 6 comments
Assignees
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: documentation (cleanup) type: process

Comments

@jin
Copy link
Member

jin commented Apr 29, 2020

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

  depends_on "[email protected]" => :build
  depends_on :java => "1.8"
  depends_on :macos => :yosemite

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.

@jin jin added area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling type: process untriaged labels Apr 29, 2020
@jin jin mentioned this issue Apr 29, 2020
10 tasks
@jin jin changed the title Clarify macOS Homebrew installation instructions Clarify macOS installation instructions and de-duplicate homebrew formulas Apr 29, 2020
@tetromino tetromino self-assigned this May 12, 2020
@tetromino tetromino added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels May 12, 2020
@tetromino
Copy link
Contributor

tetromino commented May 13, 2020

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:

  • Send a PR to update the core tap to use a Homebrew-managed OpenJDK 11 (so users won't accidentally uninstall a systemwide Java version outside of Homebrew's control, thus breaking Bazel).
  • Document that the bazelbuild tap provides the binary package (supported by the Bazel team) and the Homebrew core tap builds from source (supported by the community).
  • Add some process/documentation for the Bazel release manager to update the bazelbuild tap and to ping Homebrew core when Bazel is released.

@tetromino
Copy link
Contributor

Blocked by #11399

tetromino added a commit to tetromino/homebrew-core that referenced this issue May 14, 2020
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
@tetromino
Copy link
Contributor

Sent a PR to homebrew-core: Homebrew/homebrew-core#54712

BrewTestBot pushed a commit to Homebrew/homebrew-core that referenced this issue May 15, 2020
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]>
bazel-io pushed a commit that referenced this issue May 15, 2020
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
@jin
Copy link
Member Author

jin commented May 26, 2020

Thank you so much @tetromino!

@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed P2 We'll consider working on this in future. (Assignee optional) labels Dec 8, 2020
@keertk keertk added the team-Documentation Documentation improvements that cannot be directly linked to other team labels label Jan 10, 2023
Copy link

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.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Mar 16, 2024
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-EngProd Bazel CI, infrastructure, bootstrapping, release, and distribution tooling P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: documentation (cleanup) type: process
Projects
None yet
Development

No branches or pull requests

4 participants