Skip to content

Commit

Permalink
Homebrew is the standard on OS X
Browse files Browse the repository at this point in the history
Homebrew is the standard to for developers to install software on OS X.
* List ahead of binary installer
* Link to Homebrew
* Update Install script from brew.sh

Closes bazelbuild#16294.

PiperOrigin-RevId: 492980893
Change-Id: Ia3e543650bf29f2af6886ca76eb41897ecc0ecfd
  • Loading branch information
softwaregravy authored and copybara-github committed Dec 5, 2022
1 parent 248ff0d commit 76acfc6
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions site/en/install/os-x.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,47 @@ This page describes how to install Bazel on macOS and set up your environment.
You can install Bazel on macOS using one of the following methods:

* *Recommended*: [Use Bazelisk](/install/bazelisk)
* [Use the binary installer](#install-with-installer-mac-os-x)
* [Use Homebrew](#install-on-mac-os-x-homebrew)
* [Use the binary installer](#install-with-installer-mac-os-x)
* [Compile Bazel from source](/install/compile-source)

Bazel comes with two completion scripts. After installing Bazel, you can:

* Access the [bash completion script](/install/completion#bash)
* Install the [zsh completion script](/install/completion#zsh)

<h2 id="install-on-mac-os-x-homebrew">Installing using Homebrew</h2>

### Step 1: Install Homebrew on macOS

Install [Homebrew](https://brew.sh/) (a one-time step):

```posix-terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

### Step 2: Install Bazel via Homebrew

Install the Bazel package via Homebrew as follows:

```posix-terminal
brew install bazel
```

All set! You can confirm Bazel is installed successfully by running the
following command:

```posix-terminal
bazel --version
```

Once installed, you can upgrade to a newer version of Bazel using the
following command:

```posix-terminal
brew upgrade bazel
```

<h2 id="install-with-installer-mac-os-x">Installing using the binary installer</h2>

The binary installers are on Bazel's
Expand Down Expand Up @@ -107,35 +139,3 @@ bazel --version
```
To update to a newer release of Bazel, download and install the desired version.

<h2 id="install-on-mac-os-x-homebrew">Installing using Homebrew</h2>

### Step 1: Install Homebrew on macOS

Install Homebrew (a one-time step):

```posix-terminal
/bin/bash -c "$(curl -fsSL \
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```

### Step 2: Install Bazel via Homebrew

Install the Bazel package via Homebrew as follows:

```posix-terminal
brew install bazel
```

All set! You can confirm Bazel is installed successfully by running the
following command:

```posix-terminal
bazel --version
```

Once installed, you can upgrade to a newer version of Bazel using the
following command:

```posix-terminal
brew upgrade bazel
```

0 comments on commit 76acfc6

Please sign in to comment.