bazel-contrib / bazel-contrib/rules_go

Windows + RBE + rules_go: gotmp seems prematurely deleted

Open
#4,636 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

The gRPC team ran into an interesting issue with Windows + RBE + rules_go, specifically with [this commit](https://github.com/bazel-contrib/rules_go/pull/3885/changes), which cleans up the gotmp directory with `RMDIR %gotmp%`. Here's a snippet of the error log related to this potentially faulty code:

```
Broken (SPAWN(EXECUTION_FAILED) remote spawn failed: mandatory output external/rules_go++go_sdk+envoy_api__download_0/gotmp was not created
java.io.IOException: mandatory output external/rules_go++go_sdk+envoy_api__download_0/gotmp was not created
```

This does indeed look like a logic error. `gotmp` is in the `outputs` of the `GoToolchainBinaryBuild` action, so why is it cleaned up?

For a little more context, see gRPC's rules_go patch [here](https://github.com/grpc/grpc/blob/ca3f23c51f5a997010fa08ce8a885be80d20d328/bazel/rules_go_fix_windows_rbe.patch).

Contributor guide

Open the contributing guide

Research direction

Start with the rules_go commit linked in the issue and inspect the GoToolchainBinaryBuild action around the `RMDIR %gotmp%` cleanup. Compare it with gRPC's `bazel/rules_go_fix_windows_rbe.patch` and the reported error log; done means Windows remote execution no longer reports the mandatory `gotmp` output as missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.