Skip to content
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 combined cache not working with GCP Storage #15993

Closed
pauldraper opened this issue Jul 27, 2022 · 5 comments
Closed

Bazel combined cache not working with GCP Storage #15993

pauldraper opened this issue Jul 27, 2022 · 5 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug

Comments

@pauldraper
Copy link
Contributor

pauldraper commented Jul 27, 2022

Description 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:

  1. Remove the --disk_cache option.
  2. Use a local HTTP server (nginx) instead of GCP Storage.
  3. Use Bazel 5.1.0.
@sgowroji sgowroji added type: bug untriaged team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Jul 28, 2022
@meisterT meisterT added P1 I'll work on this now. (Assignee required) and removed untriaged labels Jul 28, 2022
@tjgq
Copy link
Contributor

tjgq commented Jul 28, 2022

It appears that this issue was introduced in 4d900ce but later fixed in a24d1bc (and cherry picked into 5.3). As a result, it made it into the 5.2 release, but neither 5.3 nor 6.0 will have the bug; I've confirmed that the provided test case doesn't repro at HEAD, nor in the 5.3 release branch.

@tjgq tjgq closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
@pauldraper
Copy link
Contributor Author

Excellent!

Now we just need a 5.3.0 release 😅

@pauldraper
Copy link
Contributor Author

pauldraper commented Jul 28, 2022

While I can believe that 4d900ce broke it, I am skeptical that a24d1bc fixed it.

@fmeum
Copy link
Collaborator

fmeum commented Jul 28, 2022

Maybe they meant 4d900ce?

@tjgq
Copy link
Contributor

tjgq commented Jul 28, 2022

Sorry, copy paste error. I meant it was fixed by 40e485d (originally #15842).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug
Projects
None yet
Development

No branches or pull requests

5 participants