Bazel sometimes execs file downloaded from remote cache before executable bits have been set #12137
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Remote-Exec
Issues and PRs for the Execution (Remote) team
type: bug
Description of the problem / feature request:
When using remote execution or remote caching and --remote_download_minimal, when a binary must be downloaded to the local machine from the remote, occasionally Bazel will attempt to execute the file before setting its executable bits.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I haven't been able to generate a simplified repeatable example because it is sensitive to other things going on in the same build. But my in-house test case looks like:
That is, there's a binary that's built and cached in remote execution, but there's some other rule that's marked "no-remote" that requires that binary to be downloaded to the local host. With --remote_download_minimal, the binary is deleted after the local execution occurs, so the download/chmod/exec cycle happens every time the binary is required.
The shell script then just does:
which occasionally leads to:
I have to build some other moderately-sized, unrelated target at the same time in order to trigger the bug. It seems like it always succeeds the first time after starting the Bazel server or after any change that causes the analysis cache to be discarded, but will reliably fail within two or three iterations after that.
What operating system are you running Bazel on?
Ubuntu 18.04
What's the output of
bazel info release
?release 3.4.1 (but have also verified that the problem is still present in release-3.6.0rc2 aa0d97c)
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Have you found anything relevant by searching the web?
No.
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: