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

README.md: fix install instructions when used with modules #751

Closed
kakulukia opened this issue Nov 15, 2018 · 7 comments
Closed

README.md: fix install instructions when used with modules #751

kakulukia opened this issue Nov 15, 2018 · 7 comments

Comments

@kakulukia
Copy link

What version of protobuf and what language are you using?
Version: none yet

What did you do?
I followed the installation instructions telling me to go get -u github.com/golang/protobuf/protoc-gen-go

What did you expect to see?
Something.

What did you see instead?
go: cannot find main module; see 'go help modules'

Anything else we should know about your project / environment?
Ubuntu with a fresh installation of go

@neild
Copy link
Contributor

neild commented Nov 16, 2018

This command doesn't work with module support turned on in the go command. The following will work for now:

GO111MODULE=off go get -u github.com/golang/protobuf/protoc-gen-go

We need to update the documentation with something that will continue to work after module support is enabled by default.

@kakulukia
Copy link
Author

okay, thx

@neild
Copy link
Contributor

neild commented Nov 19, 2018

Reopening, because this really is a problem with the documentation. (And thanks for reporting it!)

@neild neild reopened this Nov 19, 2018
@dsnet
Copy link
Member

dsnet commented Nov 19, 2018

This command doesn't work with module support turned on in the go command.

I'm not sure how to reproduce this failure. On go1.11, I run go get -u github.com/golang/protobuf/protoc-gen-go and it works regardless of whether I invoke it inside or outside the repo root.

@neild
Copy link
Contributor

neild commented Nov 20, 2018

Set GO111MODULE=on and it should fail.

@dsnet dsnet changed the title Installation broken README.md: fix install instructions when used with modules Nov 27, 2018
@dsnet
Copy link
Member

dsnet commented Nov 27, 2018

This issue is blocked on golang/go#24250 since there are limitations to the Go toolchain for what can be done here.

Arista-Jenkins pushed a commit to aristanetworks/goarista that referenced this issue Jan 11, 2019
The fork is pinned at v1.6.5 which is the last release before
influxdata/influxdb@f2898d1.
The commit is part of the larger effort in
influxdata/influxdb#10618 which makes a
breaking change.

We can't handle this with Go modules because of
golang/protobuf#751, which in turn depends on
golang/go#24250 which will be fixed with
go1.12.

Change-Id: I43b643fcab202d94bd529dfce135fb4e3f5add52
@dsnet dsnet added this to the v2 release milestone Aug 21, 2019
@dsnet dsnet removed the pending-v2 label Mar 4, 2020
@dsnet dsnet removed this from the v2 release milestone Mar 4, 2020
@dsnet
Copy link
Member

dsnet commented Mar 17, 2021

On Go1.16, you can install a binary from outside a module with:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

@dsnet dsnet closed this as completed Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants