I am building a large Bazel project in a cloud VM with /tmp
in a small filesystem (~8 GB). Occasionally my build fails with the error Not all outputs were created
: the filesystem containing /tmp
is at 99% of capacity, and /tmp
contains many Bazel build artifacts.
How can I override the temporary directory that Bazel uses? I tried setting the TEMP
and TMPDIR
environment variables when starting bazel build
, but this did not help.
You can set --output_base
to put all output in a non-default directory:
bazel --output_base=/dir/with/more/free/space build //foo
However, I don't think Bazel will use /tmp
(by default) after you've installed it (the installer does use /tmp), so perhaps you're hitting a different problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With