forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules_go.patch
30 lines (30 loc) · 1.48 KB
/
rules_go.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# Bazel RBE on Windows GCP workers currently will not invoke cmd.exe batch files correctly
#
# Symptom is program not found 'bazel-out', because of the way that the CreateProcess command
# is constructed by bazel with actions.run with forward slashes, e.g. the command
# cmd.exe /c "bazel-out/host/bin/external/go_sdk/builder.exe.bat"
# where cmd.exe on GCP is treating 'bazel-out' as the target, and /host as a command line switch.
# This problem was not observed on Azure CI pipelines or locally by the developers. The eventual
# fix is not specific to rules_go; this patch simply addresses immediate breakage and can be removed
# once the underlying issue within Bazel/RBE is fixed.
# See:
# - https://github.com/bazelbuild/rules_go/pull/2542
# - https://github.com/envoyproxy/envoy/issues/11657
#
diff --git a/go/private/rules/binary.bzl b/go/private/rules/binary.bzl
index 91748eda..c1aeb91e 100644
--- a/go/private/rules/binary.bzl
+++ b/go/private/rules/binary.bzl
@@ -443,8 +443,9 @@ def _go_tool_binary_impl(ctx):
content = cmd,
)
ctx.actions.run(
- executable = bat,
- inputs = sdk.headers + sdk.tools + sdk.srcs + ctx.files.srcs + [sdk.go],
+ executable = "cmd.exe",
+ arguments = ["/S", "/C", bat.path.replace("/", "\\")],
+ inputs = sdk.headers + sdk.tools + sdk.srcs + ctx.files.srcs + [sdk.go, bat],
outputs = [out, gopath, gocache],
mnemonic = "GoToolchainBinaryBuild",
)