dvid icon indicating copy to clipboard operation
dvid copied to clipboard

Start using go modules

Open stuarteberg opened this issue 5 years ago • 2 comments

[Disclaimer: I'm not an expert on go package management, so let me know if anything below is off-base.]

Right now, we install several third-party go dependencies via plain calls to go get, which means that the exact version of the dependency you're installing depends on the current state of the third-party's git repo at the moment you install it.

If I understand correctly, go has lacked a good, standard solution to this problem for most of it's lifetime, but there is finally (as of go-1.11) a standard solution called "modules":

https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more

We should change the dvid source code, build scripts, and developer instructions to start using modules as soon as possible. At the moment, our get-go-dependencies.sh script implements a couple of hacks to work around the "moving-target" problem described above. Those hacks can be fixed with modules.

stuarteberg avatar Jun 06 '19 19:06 stuarteberg

Yes. I've been looking into this and planned to move to this once we fixed our other build issues. A good intro is here: https://blog.golang.org/using-go-modules.

DocSavage avatar Jun 08 '19 02:06 DocSavage

Some of the major Go projects have had issues moving to Go modules. In particularly, I've noticed that gogo/protobuf and Badger are working things out. Since dgraph won't move to Go modules yet, they have Badger in a strange position.

DocSavage avatar Nov 01 '19 14:11 DocSavage