-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel doesn't respect XDG_CACHE_HOME #16937
Comments
Hello @sketch242, Could you please provide an example code to reproduce the above issue. Thanks ! |
It's not code specific, you can use anything.
|
We should fix this. |
... and until this is fixed, as a workaround, you can do |
@bazel-io fork 7.2.0 |
… and BSD It may well be that $HOME is on a read-only mount. In this case, it is the convention in the Linux and BSD world that $XDG_CACHE_HOME points to an appropriate writable location. Fixes bazelbuild#16937 RELNOTES: Bazel on Linux and BSD now respects the XDG_CACHE_HOME environment variable instead of assuming that ~/.cache/bazel is writable. PiperOrigin-RevId: 614772057 Change-Id: I6377d7a90fb929843d18e82f5ed3d0adc55ac5c6
…on Linux and BSD (#21817) It may well be that $HOME is on a read-only mount. In this case, it is the convention in the Linux and BSD world that $XDG_CACHE_HOME points to an appropriate writable location. Fixes #16937 RELNOTES: Bazel on Linux and BSD now respects the XDG_CACHE_HOME environment variable instead of assuming that ~/.cache/bazel is writable. PiperOrigin-RevId: 614772057 Change-Id: I6377d7a90fb929843d18e82f5ed3d0adc55ac5c6 Commit 05ae91f
A fix for this issue has been included in Bazel 7.2.0 RC1. Please test out the release candidate and report any issues as soon as possible. |
Description of the bug:
Bazel writes caches, often many megabytes in size to $USER/.cache/bazel on Linux. It's common for users on NFS home dirs to set the XDG_CACHE_HOME environment variable to put their caches on a local disk instead. However, bazel ignores this variable and continues to write to ~/.cache/bazel.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
export XDG_CACHE_HOME=/tmp/$USER/bazel
build anything with bazel
bazel still writes output to ~/.cache/bazel
Which operating system are you running Bazel on?
CentOS 7.9
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
Suggestions that TEST_TMPDIR is the only way to influence the output dir, along with suggestions it should not be used.
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: