Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I override the use of /tmp when building with Bazel?

Tags:

bazel

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.

like image 652
mrry Avatar asked Nov 08 '22 18:11

mrry


1 Answers

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.

like image 153
kristina Avatar answered Dec 06 '22 03:12

kristina