This is a guide for getting productive to code on CockroachDB on OS X / macOS. This assumes a blank machine/nothing is installed.
Install XCode Command Line Tools, using
Install XCode from the Mac App store and open it at least once so the developer tools can initialize.
Install the following brew packages:
brew install git
brew install --cask docker
brew install git autoconf cmake node@12 yarn go ccache bazelisk make
OS X ships with a git, but it's old. Once you install git via brew, relaunch your terminal to make sure your git version is up to date. You can confirm this by comparing the output of
to the output of
echo $(brew --prefix)/bin/git
If they match, you're using brew's
git! You also need to use brewâs
make. brew installs
make in a special directory, so you need to update your
PATH to look for it. On MacOS, you will need to add the following line to either
~/.bash_profile depending on which shell you use.
Restart your shell, and confirm this directory is being used.
Install Go. Options include:
Official installer via clicking (don't do this)
Official installer via
brew install --cask go (it's ok)
brew install go (it's ok)
from source (you already know what you're doing, right?)
Clone the repo using git and navigate into it
mkdir -p $(go env GOPATH)/src/github.com/cockroachdb
cd $(go env GOPATH)/src/github.com/cockroachdb
git clone https://github.com/cockroachdb/cockroach
Add your fork as a remote (assuming you forked cockroach on GitHub)
git remote add yourgithubusername firstname.lastname@example.org:yourgithubusername/cockroach.git
Start the docker app in the usual fashion.
You should be good to run
make! This should take a long time, as it pulls various go dependencies. Afterwards, you can start a cockroach instance usingÂ
./cockroach, e.g. ./cockroach demo.Â You can also useÂ
make buildshort, which will build the same Cockroach binary without the DB Console, which is faster to compile.