Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can also build the full cockroach binary which includes the Javascript build.

Code Block
bazel build pkg/cmd/cockroach --config=with_ui

./dev build (or equivalently, ./dev build cockroach) will do the same and will stage the binary at ./cockroach like above.

...

Warning

If you encounter build errors related to the cluster-ui dependency, you may have to clean the cache. Run ./dev ui clean --all && ./dev cache reset and retry the build.

Info

To build cockroach with the UI on older versions of the code, adding --config with_ui to the bazel build may be necessary.

Run ./dev help build for more information about what you can do with dev build. Note that you can pass additional arguments directly to bazel build by adding them after --:

...

  • You should still ask dev doctor if your machine is up-to-snuff before you try to bazel build. The checks it performs aren’t dev-specific. dev doctor also sets up a local cache for you.

  • dev prints out the (relevant) calls to bazel it makes before it does so. You can therefore run dev once just to learn how to ask Bazel to perform your build/test and then just directly call into bazel on subsequent iterations.

    • When running tests under stress, race, or --rewritedev does the legwork to invoke with the necessary flags with bazel. This involves running under another binary (stress), running with certain gotags (race), or allowing certain paths outside the bazel sandbox to be written to (testdata). Feel free to see the actual bazel command invoked and tweak as necessary.

    If you want to build with the UI, you must include the --config with_ui argument to bazel build. (dev takes care of this for you if you are using it.)
  • If you want to build a test without running it, you must include the the --config test argument to bazel build. (dev takes care of this for you if you are using it.)