Skip to content

Getting Started for new CockroachDB developers

kena edited this page May 26, 2017 · 3 revisions

This guide is for users intending to develop CockroachDB. To USE CockroachDB consult these docs instead: https://www.cockroachlabs.com/docs/install-cockroachdb.html and https://www.cockroachlabs.com/docs/start-a-local-cluster.html

This is a guide for getting productive to code on CockroachDB on OS X. This assumes a blank machine/nothing is installed.

  1. install homebrew

  2. install XCODE Command Line Tools, using

    xcode-select --install
  3. Install the following brew packages:

    brew install brew-cask git
    brew cask install docker
    brew cask install virtualbox

    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

    which git
    

    to the output of

    echo $(brew --prefix)/bin/git
    

    If they match, you're using brew's git!

  4. Install Go. Options include:

    • Official installer via clicking (don't do this)
    • Official installer via brew cask install go (it's ok)
    • homebrew via brew install go (it's ok)
    • from source (you already know what you're doing, right?)
  5. Do not clone the cockroach db repository using git, let go get do that for you, at least for the first time, so that all the dependencies are properly downloaded.

    go get -d github.com/cockroachdb/cockroach

    Once you have cloned the repository, you can navigate to the source directory ($GOPATH/src/github.com/cockroachdb/cockroach) and then add your fork as a remote (assuming you forked cockroach on GitHub)

    git remote add yourgithubusername [email protected]:yourgithubusername/cockroach.git
  6. Start the docker app in the usual fashion.

  7. You should be good to run make! This should take a long time, as it pulls various go dependencies.

  8. Run make acceptance, which pulls various docker images and runs docker-based tests. Note that this takes a very long time.