Windows: BAZEL_SH breaks remote caching #8131
Labels
area-Windows
Windows-specific issues and feature requests
P2
We'll consider working on this in future. (Assignee optional)
stale
Issues or PRs that are stale (no activity for 30 days)
team-OSS
Issues for the Bazel OSS team: installation, release processBazel packaging, website
type: bug
Description of the problem:
On Windows Bazel requires the
BAZEL_SH
environment variable to point to an msys2 installedbash.exe
. The content of this variable affects the cache key ofrun_shell
actions. This breaks remote caching of such actions ifBAZEL_SH
differs between machines. E.g. if it contains the username - as can be the case with a scoop installed msys2.Reproduction
Minimal Example
Setup a new Bazel workspace such that
Setup two separate msys2 installations
<msys_a>
and<msys_b>
.Build twice with disk cache enabled using
<msys_a>
and observe cache hit on second build:Build with disk cache enabled using
<msys_b>
and observe cache miss:(
--shell_executable
has the same effect asBAZEL_SH
wrt this issue.)Full Reproduction
Enable long path support (requires admin privileges)
Clone repository and setup scoop installation
Build target - observe many cache misses (assuming your username is not
VssAdministrator
)Copy msys2 to location matching remote cache (requires admin privileges)
Retry build and observe cache hits.
What operating system are you running Bazel on?
Windows 10
What's the output of
bazel info release
?release 0.23.2
Have you found anything relevant by searching the web?
I found this issue about removing the dependency on bash on Windows. That issue points to this design document. However, I did not find explicit mention of the remote caching issue described here.
The text was updated successfully, but these errors were encountered: