[9.1.0] Avoid copying on disk cache hits if supported by the file system (htt…#28940
Merged
iancha1992 merged 1 commit intobazelbuild:release-9.1.0from Mar 13, 2026
Merged
Conversation
…elbuild#28369) RELNOTES: Bazel no longer verifies the digests of disk cache entries upon a cache hit. This honors the description but not the previous behavior of the `--remote_verify_downloads` flag, which in fact controlled digest verification for both remote and disk caches. In the process, `LazyFileOutputStream#flush` had to be changed to not open the stream if not open yet, otherwise it would override the existing contents. Tested manually by running a fully cached build of `//src:bazel` and then verifying that `du -kh bazel-bin/src/bazel` prints `0B` on macOS. Closes bazelbuild#28369. PiperOrigin-RevId: 881397852 Change-Id: Icf3535ff31e314605c6003bd48602f6e00317022
iancha1992
commented
Mar 10, 2026
| FileSystemUtils.copyFile(path, outPath); | ||
| } else { | ||
| try (InputStream in = path.getInputStream()) { | ||
| in.transferTo(out); |
Member
Author
There was a problem hiding this comment.
In 7666e2a, it's supposed to be
try (InputStream in = path.getInputStream()) { ByteStreams.copy(in, out); }
Is this okay?
Collaborator
There was a problem hiding this comment.
in.transferTo is pretty much strictly better, not sure why I used ByteStream in the initial PR
tjgq
approved these changes
Mar 13, 2026
Merged
via the queue into
bazelbuild:release-9.1.0
with commit Mar 13, 2026
fd792c0
46 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ps://github.com//pull/28369)
RELNOTES: Bazel no longer verifies the digests of disk cache entries upon a cache hit. This honors the description but not the previous behavior of the
--remote_verify_downloadsflag, which in fact controlled digest verification for both remote and disk caches.In the process,
LazyFileOutputStream#flushhad to be changed to not open the stream if not open yet, otherwise it would override the existing contents.Tested manually by running a fully cached build of
//src:bazeland then verifying thatdu -kh bazel-bin/src/bazelprints0Bon macOS.Closes #28369.
PiperOrigin-RevId: 881397852
Change-Id: Icf3535ff31e314605c6003bd48602f6e00317022
Description
Motivation
Build API Changes
No
Checklist
Release Notes
RELNOTES: None
Commit 7666e2a