...
--cross
takes an optional argument which is the platform to cross-compile to: --cross=linux
, --cross=windows
, --cross=macos
, --cross=linuxarm
, --cross=macosarm
. dev
will copy the built binaries into the artifacts
directory in this case. Note that cross-building requires Docker. Cross-compiling should work on M1 Macs, but this support is experimental, so report issues if you should observe anyyou a docker
-compatible system installed like Rancher Desktop.
For more debugging tips on building with Bazel, see “How to ensure your code builds with Bazel”.
...
Code Block |
---|
# Build dev
./dev build dev
# Build crlfmt
./dev build crlfmt
# Build roachprod
./dev build roachprod
# Run acceptance tests
./dev acceptance
# Run compose tests
./dev compose
# Run benchmarks for pkg/sql/parser
./dev bench pkg/sql/parser
# Generate code and docs (run this before submitting your PR).
./dev generate
# Generate changes to BUILD.bazel files
./dev generate bazel --short
# Run lints
./dev lint
# logic tests!
./dev testlogic --files=$FILES --subtests=$SUBTESTS --config=$CONFIG
# Open a container running the "bazelbuilder" image. Requires Docker/Rancher Desktop/Podman/etc.
./dev builder
# Remove artifacts from building the UI
./dev ui clean --all
# Start the Bazel cache server after rebooting
./dev cache |
...
This is a (non-exhaustive) 1-to-1 mapping of dev
commands to their make
equivalents. Feel free to add to this
| equivalent non- |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add |
|
Update the | Update local sources in |
General dev
tips
The top-level dev
script uses Bazel to build pkg/cmd/dev
before running unless another dev
binary with the same increasing integer ID has already been built. Generally dev
will invoke the dev
binary “as of” that commit, which should usually be the correct behavior. However, if the default behavior does not work for some reason, you can find all the built versions of dev
under bin/dev-versions
.
...