From: William Hubbs <williamh@gentoo.org>
To: gentoo development <gentoo-dev@lists.gentoo.org>
Subject: [gentoo-dev] rfc: go 1.13 and go modules
Date: Mon, 9 Sep 2019 12:34:18 -0500 [thread overview]
Message-ID: <20190909173418.GA30003@whubbs1.dev.av1.gaikai.org> (raw)
[-- 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 --]
next reply other threads:[~2019-09-09 17:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 17:34 William Hubbs [this message]
2019-09-09 18:19 ` [gentoo-dev] rfc: go 1.13 and go modules 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190909173418.GA30003@whubbs1.dev.av1.gaikai.org \
--to=williamh@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox