Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: precompiled protoc-gen-go release binaries #738

Closed
jgiles opened this issue Oct 28, 2018 · 5 comments
Closed

process: precompiled protoc-gen-go release binaries #738

jgiles opened this issue Oct 28, 2018 · 5 comments

Comments

@jgiles
Copy link

jgiles commented Oct 28, 2018

Is your feature request related to a problem? Please describe.
Currently it can be tricky for teams to ensure they are using consistent versions of protoc-gen-go (the installation instructions on the repo suggest go get -u github.com/golang/protobuf/protoc-gen-go). Version management is particularly important here because protoc-gen-go is often part of build processes which are meant to be reproducible.

Describe the solution you'd like
Pre-compiled, per-platform release binaries, similar to protoc /~https://github.com/protocolbuffers/protobuf/releases or dep /~https://github.com/golang/dep/releases

Describe alternatives you've considered
None.

Additional context
A set of release binaries also makes protoc-gen-go easier to integrate with version-management tooling such as /~https://github.com/asdf-vm/asdf

@dsnet
Copy link
Member

dsnet commented Nov 5, 2018

I have no objections to this and think its a good idea. It does mean that we'll need to improve our process for tagging and marking new releases on GitHub. I'll look into what it takes to do this, but I'll be honest that this is somewhat of a low priority item at the moment.

@dsnet dsnet changed the title Proposal: protoc-gen-go precompiled release binaries process: precompiled protoc-gen-go release binaries Nov 5, 2018
@MartinNiederl
Copy link

Any updates on this?

@dsnet
Copy link
Member

dsnet commented Feb 26, 2019

No updates. Pre-compiled binaries requires some more release tooling than we have the bandwidth to work on now. That said, Go 1.12 was recently released, which makes it much easier. Using go1.12, you can do:

GO111MODULE=on go get github.com/golang/protobuf/protoc-gen-go@v1.3.0

@bufdev
Copy link

bufdev commented Feb 27, 2019

Also of note, as of Golang 1.12, if you have Golang installed, you don't want to edit any go.mod to include golang/protobuf, you can do this (copied from a Makefile):

UNAME_OS := $(shell uname -s)
UNAME_ARCH := $(shell uname -m)

TMP_BASE := .tmp
TMP := $(TMP_BASE)/$(UNAME_OS)/$(UNAME_ARCH)
TMP_BIN = $(TMP)/bin

export GO111MODULE := on
export GOBIN := $(abspath $(TMP_BIN))
export PATH := $(GOBIN):$(PATH)

PROTOC_GEN_GO_VERSION := v1.3.0
PROTOC_GEN_GO := $(TMP_BIN)/protoc-gen-go
$(PROTOC_GEN_GO):
	$(eval PROTOC_GEN_GO_TMP := $(shell mktemp -d))
	@cd $(PROTOC_GEN_GO_TMP); go get github.com/golang/protobuf/protoc-gen-go@$(PROTOC_GEN_GO_VERSION)
	@rm -rf $(PROTOC_GEN_GO_TMP)

You can then call protoc-gen-go within your Makefile as it will be on your PATH (so --go_out will automatically use it).

gopherbot pushed a commit to protocolbuffers/protobuf-go that referenced this issue Aug 21, 2019
Updates golang/protobuf#738

Change-Id: I6dd85ff0129bfcfb67b12b06549c568eebfd68e3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/189342
Reviewed-by: Damien Neil <dneil@google.com>
@dsnet dsnet added this to the v2 release milestone Aug 21, 2019
@dsnet
Copy link
Member

dsnet commented Mar 3, 2020

Pre-compiled binaries are attached to the release page for v1.20.0 for x86 and amd64 on Linux, OSX, and Windows.

@dsnet dsnet closed this as completed Mar 3, 2020
@golang golang locked as resolved and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants