...
Follow the directions on "Getting and building CockroachDB from source" or "Building from source on macOS" to get your development environment set up.
Note that you do need a full installation of XCode to build on macOS. (No, a command-line tools instance does not suffice.) If you’ve already installed a command-line tools instance as part of setting up Homebrew or other tools, switch to the full XCode instance and accept the XCode license agreement with:
...