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
Clarify repository_cache documentation #8496
Comments
This also bit me just now, for the exact reasons @keith reported. Any opposition to either updating the docs or changing the default? |
On top of that, I can't figure out how to turn this on (at the default path) at all. E.g., if I provide a no-op option like Anyone have a better solution? |
I can't find the author of the proposal on here, but cc: @aehlig who wrote much of the code. |
Looking. |
FWIW, I did the following and couldn't repro:
After this I see again cached files in my local repository cache. |
@meisterT -- confirming everything, here's my repro: checkout Batfish: https://github.com/batfish/batfish (but probably anything would work)
That jar depends on external dependencies from
|
Repeating with only changing the
|
The location of the repository cache on macOS is:
Seems like a documentation issue, instead of a implementation one. |
Interesting! Do you know why? Certainly, I'd prefer a default location that is persistent. |
It is set here: It was changed in There were two issues mentioned in the commit:
The first is not a real blocker (if it's still true). I don't have a Mac, but perhaps a rollback of above commit is already a good enough fix. |
@meisterT Woud you consider changing the default output root (hence output base, execroot..) a breaking change? |
Oh, that's a good question. On the one hand it's a bug fix, on the other hand there may be people relying on it. Cc @dslomov A reasonable compromise would be to make this flag guarded but default the flag to true and inform bazel discuss. |
I wonder if this is just a documentation isssue. While the repository cache is in a different location than people think, it should be persisted across reboots IIUC (see https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html). Since I don't have a Mac, someone else needs to confirm. @dhalperi @keith when you say it bit you, is it possible that you were just surprised because it's in a different folder or did you actually see a cache miss where you expected a hit? |
I just rebooted as a test, it did persist. How I was affected: I was looking at which directory to mount into docker to reuse, and it wasn't there. Then I tried ten options to create it, didn't work. Runtime effects I cannot effectively recall made me think that there was no local repository cache. One plausibly contributing factor is that you can't (or I can't - is there a way?) tell downloading from other work during |
I can confirm that the behaviour seen in this comment is what I see on macOS using Bazel 5.2.0 i.e. a default value is used on macOS, and the location is filled with cache entries:
Could this issue be closed? I don't think there is a documentation issue (aside from using a linux-specific location for the default). In its current form, the issue creates confusion (it suggests that the |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
Currently in the user guide there is this sentence:
This implies to me that if you don't pass
--repository_cache
, it is enabled at this default path. Based on this logicbazel/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
Lines 220 to 265 in fa654b4
What is the desired behavior here? Should we update the docs or update this logic to enable the cache by default? The latter sounds preferred to me unless there is a known issue where users wouldn't want this enabled by default?
The text was updated successfully, but these errors were encountered: