Bazel combined cache not working with GCP Storage
See original GitHub issueDescription of the bug:
As of 5.2.0, Bazel doesn’t download from GCP storage when the disk cache is used.
What’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
WORKSPACE.bazel
BUILD.bazel
genrule(
name = "example",
cmd = "date; echo example > $@",
outs = ["example.txt"],
)
.bazelrc
build --disk_cache=~/.cache/bazel-disk
build --google_default_credentials
build --remote_cache=https://storage.googleapis.com/example-bucket
Build:
bazel build :example
Then clean:
bazel clean
rm -r ~/.cache/bazel-disk/*
Then build again:
bazel build :example
The output for the last step shows: 2 processes: 1 internal, 1 linux-sandbox.
It ought to display: 2 processes: 1 remote cache hit, 1 internal.
Which operating system are you running Bazel on?
Ubuntu 20.04
What is the output of bazel info release
?
release 5.2.0
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 master; git rev-parse HEAD
?
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
Oddly, this works as expected if I do any one of the following:
- Remove the
--disk_cache
option. - Use a local HTTP server (nginx) instead of GCP Storage.
- Use Bazel 5.1.0.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Google Cloud Storage Cache Strategy · Issue #2512 - GitHub
The main problem currently is that Bazel has no good mechanism for consulting a cache prior to actually executing an action. @ulfjack and...
Read more >Remote Caching - Bazel
This page covers remote caching, setting up a server to host the cache, and running builds using the remote cache. A remote cache...
Read more >Remote Cache with Google Cloud Storage provides no net ...
On a side note, when I was tuning Cirrus CI's HTTP Cache for Bazel I noticed that Bazel uploads and downloads a lot...
Read more >Fast, cheap and globally accessible Bazel remote cache on ...
Bazel implements remote caching over several protocols: HTTP/WebDAV, gRPC and Google Cloud Storage (which is HTTP really).
Read more >Setting up a shared build cache using Bazel - Tweag
Action outputs can be cached, so that running another build does not require executing all actions again. There are two levels of caching...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, copy paste error. I meant it was fixed by 40e485dc67 (originally https://github.com/bazelbuild/bazel/pull/15842).
Maybe they meant https://github.com/bazelbuild/bazel/commit/4d900ceea12919ad62012830a95e51f9ec1a48bb?