Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Cc: mgorny@g.o
Subject: Re: [gentoo-dev] [PATCH 1/1] go-module.eclass: new eclass for go modules
Date: Thu, 26 Sep 2019 00:21:50
Message-Id: 20190926002116.GA4964@whubbs1.dev.av1.gaikai.org
In Reply to: Re: [gentoo-dev] [PATCH 1/1] go-module.eclass: new eclass for go modules by "Michał Górny"
1 On Wed, Sep 25, 2019 at 10:02:34PM +0200, Michał Górny wrote:
2 > On Tue, 2019-09-24 at 13:08 -0500, William Hubbs wrote:
3
4 *snip*
5
6 > > +# @DESCRIPTION:
7 > > +# This eclass provides basic settings and functions
8 > > +# needed by all software written in the go programming language that uses
9 > > +# go modules.
10 > > +#
11 > > +# You will know the software you are packaging uses modules because
12 > > +# it will have files named go.sum and go.mod in its top-level source
13 > > +# directory. If it does not have these files, use the golang-* eclasses.
14 >
15 > Hmm, don't we want to eventually have one eclass that fits all packages?
16 > I mean, if you can automatically determine whether modules are present
17 > via go.mod file, can't you just make one eclass that determines that
18 > and passes correct flags for both cases?
19
20 I hadn't thought about making one eclass for several reasons.
21
22 The primary reason is that go upstream is pushing toward all go devs
23 using modules, so ultimately building without using modules will be
24 unsupported.
25
26 The second reason is part of the API for a combined eclass would have to
27 be a global scope variable to tell the eclass whether or not to use
28 modules. The reason for this is src_unpack has to behave differently
29 based on whether or not the package uses modules.
30
31 Also, most of the machinery in the golang-* eclasses deals with
32 manipulating/using GOPATH which is completely irrelivent for modules.
33 golang-vcs-snapshot.eclass and golang-vcs.eclass are only needed if your
34 package is not using modules.
35
36 The tl;dr is that Go builds are becoming much simpler to deal with
37 because of go modules.
38
39 If you think there is functionality in the golang-* eclasses that is
40 generic enough to add to this eclass, let me know.
41
42 I'm about to send out a re-roll that I think covers your changes.
43
44 William

Attachments

File name MIME type
signature.asc application/pgp-signature