-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Move default output root on macOS to $HOME/Library/Caches
#25262
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
Move default output root on macOS to $HOME/Library/Caches
#25262
Conversation
|
This is an incompatible change, but arguably one that doesn't need to be gated by a flag. We do need to make sure that
An additional question is what to do about the documentation at https://bazel.build/remote/output-directories - I assume many bazel 8 users will check that page (even though it's for bazel-at-head). So maybe we need phrasing along the lines of "this is how things work in bazel 9, and that is how they used to work in bazel 8 and earlier". |
This comment was marked as resolved.
This comment was marked as resolved.
|
Did some code searching. Needs to be fixed:
Already fixed:
|
tetromino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update output-directories.md.
I'd suggest something like the following wording:
- The outputRoot directory defaults to
~/.cache/bazelon Linux,
~/Library/Caches/bazelon macOS (when using Bazel 9 and newer), and on Windows it defaults to%HOME%if
set, else%USERPROFILE%if set, else the result of calling
SHGetKnownFolderPath()with theFOLDERID_Profileflag set. If the
environment variable$XDG_CACHE_HOMEis set on either Linux or
macOS, the value${XDG_CACHE_HOME}/bazelwill override the default.
If the environment variable$TEST_TMPDIRis set, as in a test of Bazel
itself, then that value overrides any defaults.- Note that Bazel 8.x and earlier on macOS used
/private/var/tmpas outputRoot, and ignored$XDG_CACHE_HOME.
- Note that Bazel 8.x and earlier on macOS used
|
Thanks for the feedback @tetromino! I've addressed it in the latest commit. I'm happy to continue working with you to iterate on this as needed. I don't know if I'm the best person to work on those other identified points, since some of them are internal to Google and others seem to require some inter-repo coordination, but let me know what you want from me! |
|
@tetromino Can you take another look? |
|
@tetromino would you mind taking another look at this? |
|
@tetromino bumping this. would you mind taking another look at this PR? |
|
I got feedback from Bazel users at Google asking to move the default output root to /tmp (a.k.a. /private/tmp) instead. On macOS, /tmp gets wiped on reboot by default, which keeps keeps the amount of disk space used by Bazel in check. Apparently, running out of disk space due to Bazel is a problem that many engineers experienced - one user reported >200 GB in their output root at one point. In light of this, I'd like to defer this PR review and first discuss what we want to do with the output root in #25260 |
|
Quoting @ashgti from internal bug report: Some notes on folders macOS uses:
End of quote. Since The fix for @nglevin's issue might be to launch bazel with Footnotes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking about this for a while, I think it's ok.
If we get complaints, we'll roll it back.
The solution for the running-out-of-space problem might be to set --user_cache_dir=$(getconf DARWIN_USER_TEMP_DIR) in the script that launches Bazel.
Fixes bazelbuild#25260 Implements the request made [here](bazelbuild#25205 (comment)) and moves the default output root on macOS from `/private/var/tmp` to `$HOME/Library/Caches`. May constitute an incompatible change, though on a cursory glance I didn't see any precedent for incompatible startup options in source. Closes bazelbuild#25262. PiperOrigin-RevId: 840604399 Change-Id: I391b805b2c8e99d3ffe44a76e916d1c9839225e5
…27875) Fixes #25260 Implements the request made [here](#25205 (comment)) and moves the default output root on macOS from `/private/var/tmp` to `$HOME/Library/Caches`. May constitute an incompatible change, though on a cursory glance I didn't see any precedent for incompatible startup options in source. Closes #25262. PiperOrigin-RevId: 840604399 Change-Id: I391b805b2c8e99d3ffe44a76e916d1c9839225e5 Commit 13da9a1 Co-authored-by: Aaron Sky <[email protected]>
Fixes #25260
Implements the request made here and moves the default output root on macOS from
/private/var/tmpto$HOME/Library/Caches. May constitute an incompatible change, though on a cursory glance I didn't see any precedent for incompatible startup options in source.