...
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
If you have
ccache
installed,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
), and then you might need to dobazel clean --expunge
.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
...