bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Please rename TEST_TMPDIR to TMPDIR, and set it for all actions

Open EdSchouten opened this issue 3 months ago • 1 comments

Description of the feature request:

Right now we have TEST_TMPDIR. Unfortunately almost no software out there respects that environment variable. Meanwhile a lot of software does respect plain TMPDIR.

In addition to that, we don't set this environment variable for plain build actions. This leads to many people writing actions that write straight into /tmp. If an action times out or gets killed, it may not clean up the files it leaves behind. This leads to systems running Bazel gradually running out of disk space.

If Bazel is smart enough to create a temporary directory for test actions, why can't it do it for all actions?

Which category does this issue belong to?

No response

What underlying problem are you trying to solve with this feature?

Computers running out of disk space.

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

A recent one

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?


Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

EdSchouten avatar Oct 06 '25 16:10 EdSchouten

I submitted https://github.com/bazelbuild/bazel/pull/27863 which at least adds this for test targets.

keith avatar Dec 04 '25 19:12 keith