feat: Add default disk cache location via --disk_cache=on#28942
feat: Add default disk cache location via --disk_cache=on#28942Desel72 wants to merge 2 commits intobazelbuild:masterfrom
Conversation
|
@gregestren @meteorcloudy could you please review my pr and share any feedback? |
|
Thanks for your first contribution here.
|
|
Hi @tjgq, just following up on this PR. If possible, could you please take a look and share your feedback? |
| if (outputUserRoot == null) { | ||
| throw createOptionsExitException( | ||
| "--disk_cache=on requires --output_user_root to be set", | ||
| FailureDetails.RemoteOptions.Code.EXECUTION_WITH_INVALID_CACHE); |
There was a problem hiding this comment.
This is strange.....if following the standard outputUserRoot resolution, it should be set
|
@pauldraper You're right — |
|
Having a magic string that isn't used in other options isn't that great. Could we use the same trick as in |
|
Thank you for your feedback @fmeum I am going to address the magic strings with following way: |
|
Please wait for |
|
I also prefer @fmeum's suggested approach. |
Is my approach ok to you? |
Description
Add support for
--disk_cache=onand--disk_cache=offsentinel values.--disk_cache=onplaces the disk cache in a default location at<outputUserRoot>/cache/disk, alongside the existing repository cache at<outputUserRoot>/cache/repos/v1.--disk_cache=offexplicitly disables the disk cache (equivalent to not setting the flag).Motivation
Fixes #28899
Currently,
--disk_cacherequires an explicit path, forcing users to choose and manage a location. With--disk_cache=on:XDG_CACHE_HOME) sinceoutputUserRootalready respects them.Build API Changes
onandoffchange behavior (previously they would have been interpreted as relative directory names).Checklist
Release Notes
RELNOTES[NEW]:
--disk_cache=onnow places the disk cache in a default location under the output user root (<outputUserRoot>/cache/disk).--disk_cache=offexplicitly disables the disk cache.