Skip to content

Commit b9ff433

Browse files
WorkerPantstdyas
andauthored
golang: allow downloads during instalation of gRPC protobuf plugins (Cherry-pick of #21614) (#21856)
As described in #21529, the Go rules are setting `GOPROXY=off` during the invocations of `go install` to install the gRPC protobuf plugins because that is the default for `GoSdkProcess`. The plugin builds are failing because `GOPROXY=off` prevents `go` from contacting the Go module proxy to learn about module deprecations. (Unlike other uses of `GoSdkProcess`, the gRPC protobuf plugins are relying on `go install` to do a full build of the plugin sources, which is unlike the use of `GoSdkProcess` in the rest of the Go backend rules.) Solution: Set `allow_downloads=True` (which is already done for a preceding `go mod download`) to allow `go` to contact the Go module proxy as needed by not setting `GOPROXY=off`. Fixes #21529. Co-authored-by: Tom Dyas <[email protected]>
1 parent 3b89c87 commit b9ff433

File tree

1 file changed

+4
-0
lines changed
  • src/python/pants/backend/codegen/protobuf/go

1 file changed

+4
-0
lines changed

src/python/pants/backend/codegen/protobuf/go/rules.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ async def setup_go_protoc_plugin() -> _SetupGoProtocPlugin:
599599
input_digest=download_sources_result.output_digest,
600600
output_files=["gopath/bin/protoc-gen-go"],
601601
description="Build Go protobuf plugin for `protoc`.",
602+
# Allow `go` to contact the Go module proxy since it will run its own build.
603+
allow_downloads=True,
602604
),
603605
),
604606
Get(
@@ -611,6 +613,8 @@ async def setup_go_protoc_plugin() -> _SetupGoProtocPlugin:
611613
input_digest=download_sources_result.output_digest,
612614
output_files=["gopath/bin/protoc-gen-go-grpc"],
613615
description="Build Go gRPC protobuf plugin for `protoc`.",
616+
# Allow `go` to contact the Go module proxy since it will run its own build.
617+
allow_downloads=True,
614618
),
615619
),
616620
)

0 commit comments

Comments
 (0)