From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 755A1138334 for ; Mon, 9 Sep 2019 17:34:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 298C6E0964; Mon, 9 Sep 2019 17:34:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C4E96E095F for ; Mon, 9 Sep 2019 17:34:22 +0000 (UTC) Received: from whubbs1.gaikai.biz (unknown [100.42.103.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: williamh) by smtp.gentoo.org (Postfix) with ESMTPSA id B0C2234AEF4 for ; Mon, 9 Sep 2019 17:34:21 +0000 (UTC) Received: (nullmailer pid 31244 invoked by uid 1000); Mon, 09 Sep 2019 17:34:18 -0000 Date: Mon, 9 Sep 2019 12:34:18 -0500 From: William Hubbs To: gentoo development Subject: [gentoo-dev] rfc: go 1.13 and go modules Message-ID: <20190909173418.GA30003@whubbs1.dev.av1.gaikai.org> Mail-Followup-To: gentoo development Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Archives-Salt: e8b9f709-a199-4b10-8781-5971dbb9fd9b X-Archives-Hash: bfe2efb9386b92acd486c23014869e2c --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCXXaNFAAKCRBuVBb0MMRl OCH7AKCd4gLQ3PDMqXmqmWJpgB9wBAFvHgCgoNSJ+VKnOqO+r1A8MKq+e83rXqE= =bBVY -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--