bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.21k stars 4.07k forks source link

Add an option to skip copying remote cache entries into the disk cache when using a combined cache #23705

Open dkashyn-sfdc opened 1 month ago

dkashyn-sfdc commented 1 month ago

Description of the feature request:

Duplication of all of RemoteCache entries requires too much local disk space.

While DiskCache is beneficial for local rebuilds, it would be great to not flood it with RC entries if requested.

See discussion for this subject here https://bazelbuild.slack.com/archives/CA31HN1T3/p1726511948332319

Which category does this issue belong to?

No response

What underlying problem are you trying to solve with this feature?

Reduce overhead from DiskCache when the majority of entries are pulled from RC and we building once, for example in CI case.

Which operating system are you running Bazel on?

All of them

What is the output of bazel info release?

7.2.1

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 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?

No response

dkashyn-sfdc commented 1 month ago

Conditions here https://github.com/bazelbuild/bazel/blob/8683da90fb192a030fedb3191cc187e829f88ef2/src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java#L399 and probably here https://github.com/bazelbuild/bazel/blob/8683da90fb192a030fedb3191cc187e829f88ef2/src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java#L128 should probably check for that additional option.