cockroachdb/cockroach
dev
./dev is the wrapper around Bazel that contributors use day-to-day. Source: pkg/cmd/dev/. The script at the repo root (./dev) builds and runs the version of the tool matching the checked-out commit.
Why a wrapper
Bazel is powerful but verbose. dev provides:
- Aliases for common targets (
dev test pkg/sqlinstead ofbazel test //pkg/sql:sql_test). - Environment-aware defaults (
dev test --short,dev test --race,dev test --stress). - Automatic copying of binaries out of Bazel's output tree (e.g.
./cockroachis staged in the repo root afterdev build). - Friendly error messages and
dev doctorfor environment validation. - Hooks for codegen (
dev gen) and formatting (dev lint).
Sub-commands
| Command | Purpose |
|---|---|
build |
Build a binary or package |
test |
Run tests |
testlogic |
Run SQL logic tests |
gen |
Code generation |
lint |
Lint |
bench |
Microbenchmarks |
doctor |
Environment validation |
compose |
Run a docker-compose-based test scenario |
mergetest |
Merge test runs |
acceptance |
Run acceptance tests |
dev <command> --help is exhaustive.
Implementation
The CLI uses Cobra and dispatches to per-command files (pkg/cmd/dev/build.go, pkg/cmd/dev/test.go, …). It runs Bazel as a subprocess and parses its output. The gen subcommands additionally invoke standalone tools (crlfmt, protoc, optgen) that live elsewhere in the tree.
Related pages
- How to contribute / development workflow — usage patterns.
- How to contribute / tooling — tooling surrounding
dev.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.