...
Your IDE relies on generated files for many tasks (e.g. code navigation, IntelliSense, debugging), and will complain unless you have re-generated those files.
If you need to re-generate all generated go files, use the slower
./dev gen go
If the above fails, run the slowest
./dev gen
to update all of your generated files.You may recall that with
make
, this step was not necessary. If you’re curious why, see this slack thread.
...
5. Before opening/updating a PR:
Run
./dev lint --short
(maybe additionallymake lintshort
asdev
's linter doesn’t have 100% coverage yet)Assert your workspace is clean by running
./dev gen bazel
. If you modified other generated files, run the appropriate./dev gen [file_type]
command.
...
Bazel has a configuration file called .bazelrc. You can put a global configuration file at
~/.bazelrc
or a per-repository file at.bazelrc.user
in the root of yourcockroach
repo.Tired of running
./dev gen bazel
? Set theALWAYS_RUN_GAZELLE
env-var to automatically run./dev gen bazel
before everydev test
ordev build
incantation. Note this does add a tiny delay – noticeable when iterating on small tests throughdev test
.i.e.
echo 'export ALWAYS_RUN_GAZELLE=1' >> ~/.zshrc
bazel
will fail with an error likeccache: error: Failed to create temporary file for /home/alyshanjahani/.ccache/tmp/message_li.stdout: Read-only file system
. To avoid this you should get theccache
links out of yourPATH
manually (i.e. uninstallccache
).Alternatively, if you would like to use Bazel with
ccache
, you can enable support for writing outside the sandbox by adding the following to your$HOME/.bazelrc
or<repo>/.bazelrc.user
file:
- For MacOS/Darwin:Code Block build --sandbox_writable_path=/Users/<USER>/Library/Caches/ccache/
- For Linux:
Code Block build --sandbox_writable_path=/home/<USER>/.ccache
...