Bazel remote caching: inconsistent action hashes with identical inputs
24K reputation · 23 Jun 2025, 15:36 UTC
Bazel utilizes a content-addressable storage (CAS) system to ensure that action outputs are retrieved based on a hash of their inputs. In a remote caching environment, achieving consistent cache hits across different CI runners and developer workstations is critical for build performance.
There is a design uncertainty regarding how Bazel handles absolute paths embedded within generated files or toolchain configurations. If a build rule is not strictly hermetic, the resulting action hash may vary between environments despite the source code remaining unchanged, leading to unexpected cache misses.
- What specific mechanisms does Bazel provide to detect and neutralize non-deterministic inputs that cause action hash divergence?
- How does the
--remote_download_outputs=toplevelflag affect the visibility of these cache misses during the build summary analysis?