[opensuse-packaging] Re: [opensuse-go] Go Modules
Aleksa Sarai writes:
We are going to be facing quite a few issues in the near future because of Go modules. Go 1.11 added this concept of modules, which is supposed to eventually replace vendor/ and all of the other awful systems Go developers have had to deal with for the many years.
Indeed, I'm very glad to have modules in Go. The transition period will be a challenge, as upstream Go projects migrate at their own pace from using 'dep' et al. and/or complex targets in their Makefile to gather dependency sources. My hope is that in the not too distant future, most Go projects will be buildable offline, without GOPATH setup, following a 'go mod vendor' call from an OBS source service, as you mention below.
In order to stop "go build" from downloading stuff from the internet (which is disallowed in OBS obviously) you need to pass "-mod=vendor".
The kicker is that only Go 1.11 supports "-mod=vendor", while "go build" supports Go modules as far back as Go 1.9.
Did you mean Go modules or 'finds dependencies in vendor/' (Go 1.6)?
So when building currently we have to delete go.mod and go.sum.
Can you expand a bit on the cases where go.{mod,sum} need to be deleted? With go1.11 I've been using env var GO111MODULE={auto|on|off}, does that cover those cases?
I proposed about a year ago that we should have some OBS service to deal with the vendoring problem by automating the pulling and setting up of vendor directories. Personally I think it's about time I dust off that idea and actually get to work on it -- since we now are going to need it for Go since (as I've discovered) some projects don't commit a vendor/ anymore.
I've been thinking about this as well and intend to contribute. What implementation are you envisioning for an OBS source service: calling the 'go mod vendor' CLI from one of bash, python, or a Go executable? Jeff -- Jeff Kowalczyk Software Engineer, Go Developer Experience SUSE Linux -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (1)
-
Jeff Kowalczyk