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
all: Become a Go module (fixes #5148) #5384
Conversation
So there's a hilarious amount of protocol failures due to updating the protobuf package, so that's interesting and merits investigation... |
This is not user facing, and should really only affect those juggling dependencies or wanting to work without gopath. Given that, is anyone strongly opposed to this change, @AudriusButkevicius @imsodin ? |
This is probably the future, so I am ok with that. I am not planning to review the diff as I presume it's a massive noop change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I knew how to deal with the oddities of gvt, now I guess I'll have to learn about go mod - I don't mind.
Welcome to the future. Now to fix all the unexpected build failures... |
Purpose
Use the new hotness. Build cleanly outside
GOPATH
. Use modern tools for vendoring.The changes in more detail:
Our dependencies are now declared in go.mod & go.sum. Managing these is done using
go get
,go get -u
,go mod tidy
,go mod vendor
while in the modules mode (GO111MODULE=on
or outsideGOPATH
).The vendor directory is still populated, using
go mod vendor
. This means there is no difference in building stuff for those still usingGOPATH
etc. In the long run, Go 1.12+, we can drop the vendor dir.The non-Go dependencies we have for
go generate
(protobuf schemas), and the XDR builder, aren't easily accessible as modules. Instead I hacked the build script to clone and check out the stuff we need, if it isn't already present, when we rungo run build.go proto
. This isn't done very often by most developers, so I think it's fine.I removed the stuff in build.go for juggling GOPATH and building outside of it. If you're outside GOPATH today and on a modern compiler, the module support will kick in instead.
Testing
It still builds for me.