public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] rfc: go 1.13 and go modules
@ 2019-09-09 17:34 William Hubbs
  2019-09-09 18:19 ` Zac Medico
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: William Hubbs @ 2019-09-09 17:34 UTC (permalink / raw
  To: gentoo development

[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]

All,

First off, everything I'm saying here is definitely open to discussion;
they are issues I have found with go 1.13.

with Go 1.13, go modules are the default way to build software written
in Go. If upstream has a go.mod file in their distribution, this
version of Go will assume that they are using modules unless modules are
disabled explicitly by setting the GO111MODULE environment variable to
off[1], so if your upstream does not have go.mod, it will work as
before.

This is not turned off globally because upstream is encouraging projects
to move to using modules [3] [4].

So far, here is what I've found if an upstream uses go modules.

dev-vcs/hub vendors the modules into their upstream repository using
"go mod vendor" and keeps go.mod and go.sum up to date. The build commands in
their makefiles use the "-mod vendor" switch as well. In this case,
the ebuild author doesn't have to do anything about the modules.

If the modules are not vendored (there is no vendor directory in the
upstream repository), the only option I've tried so far is to run "go
mod vendor" in the root of the upstream repository then tar up the
vendor directory and mirror it on our infrastructure. In that scenario,
you need to add "-mod vendor" to any "go build" commands upstream uses
and have a src_prepare function that moves the vendor directory into the
appropriate place. See www-apps/trickster (not trickster-bin). This also
seems to avoid the module mirror database.

There is another option I want to try which is adding "go mod vendor" to
src_unpack for go packages.

Thoughts?

Thanks,

William

[1] https://golang.org/cmd/go/#hdr-Module_support
[2] https://golang.org/doc/go1.13#modules
[3] https://blog.golang.org/migrating-to-go-modules
[4] https://blog.golang.org/using-go-modules

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-09-10 18:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-09 17:34 [gentoo-dev] rfc: go 1.13 and go modules William Hubbs
2019-09-09 18:19 ` Zac Medico
2019-09-09 18:41   ` William Hubbs
2019-09-09 19:00     ` Michał Górny
2019-09-09 22:10       ` William Hubbs
2019-09-09 22:25         ` Alec Warner
2019-09-09 18:54   ` Michael Orlitzky
2019-09-09 19:04     ` William Hubbs
2019-09-09 19:00 ` Ulrich Mueller
2019-09-09 20:35 ` Kent Fredric
2019-09-09 21:46   ` William Hubbs
2019-09-09 22:57     ` Georgy Yakovlev
2019-09-09 23:21       ` William Hubbs
2019-09-10 18:31         ` William Hubbs
2019-09-10 18:58           ` Kent Fredric
2019-09-10  1:15     ` Kent Fredric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox