Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Cc: "Robin H. Johnson" <robbat2@g.o>
Subject: Re: [gentoo-dev] [PATCH 1/3] eclass/go-module: add support for building based on go.sum
Date: Sun, 09 Feb 2020 22:11:36
Message-Id: 20200209221128.GA18257@linux1.home
In Reply to: [gentoo-dev] [PATCH 1/3] eclass/go-module: add support for building based on go.sum by "Robin H. Johnson"
1 On Sun, Feb 09, 2020 at 12:31:19PM -0800, Robin H. Johnson wrote:
2 > EGO_SUM mode now supplements the existing EGO_VENDOR mode.
3 >
4 > EGO_SUM should be populated by the maintainer, directly from the go.sum
5 > file of the root package. See eclass and conversion example
6 > (dev-go/go-tour & app-admin/kube-bench) for further details.
7 >
8 > The go-module_set_globals function performs validation of
9 > inputs and does die on fatal errors.
10 >
11 > Signed-off-by: Robin H. Johnson <robbat2@g.o>
12 > ---
13 > eclass/go-module.eclass | 328 +++++++++++++++++++++++++++++++++++--
14 > profiles/thirdpartymirrors | 1 +
15 > 2 files changed, 311 insertions(+), 18 deletions(-)
16 >
17 > diff --git eclass/go-module.eclass eclass/go-module.eclass
18 > index d5de5f60ccdf..b8a635d52de7 100644
19 > --- eclass/go-module.eclass
20 > +++ eclass/go-module.eclass
21 > @@ -4,22 +4,46 @@
22 > # @ECLASS: go-module.eclass
23 > # @MAINTAINER:
24 > # William Hubbs <williamh@g.o>
25 > +# @AUTHOR:
26 > +# William Hubbs <williamh@g.o>
27 > +# Robin H. Johnson <robbat2@g.o>
28 > # @SUPPORTED_EAPIS: 7
29 > # @BLURB: basic eclass for building software written as go modules
30 > # @DESCRIPTION:
31 > -# This eclass provides basic settings and functions
32 > -# needed by all software written in the go programming language that uses
33 > -# go modules.
34 > +# This eclass provides basic settings and functions needed by all software
35 > +# written in the go programming language that uses go modules.
36 > +#
37 > +# You might know the software you are packaging uses modules because
38 > +# it has files named go.sum and go.mod in its top-level source directory.
39 > +# If it does not have these files, try use the golang-* eclasses FIRST!
40 > +# There ARE legacy Golang packages that use external modules with none of
41 > +# go.mod, go.sum, vendor/ that can use this eclass regardless.
42 > +#
43 > +# Guidelines for usage:
44 > +# "go.mod" && "go.sum" && "vendor/":
45 > +# - pre-vendored package. Do NOT set EGO_SUM or EGO_VENDOR.
46 > +#
47 > +# "go.mod" && "go.sum":
48 > +# - Populate EGO_SUM with entries from go.sum
49 > +# - Do NOT include any lines that contain <version>/go.mod
50 > +#
51 > +# "go.mod" only:
52 > +# - Populate EGO_VENDOR
53
54 go.mod without go.sum can mean that there are no external dependencies, so there
55 shouldn't be a reason to populate EGO_VENDOR in this case.
56
57 Here is a valid go.mod:
58
59 --- cut here ---
60 module github.com/williamh/get-ego-vendor
61
62 go 1.12
63 --- cut here ---
64
65 If go.mod has require lines in it and go.sum doesn't exist, this is
66 an issue to address upstream.
67
68 The way I see this going is to transition to EGO_SUM and
69 drop EGO_VENDOR. unless I'm missing something.
70
71
72 Thanks,
73
74 William

Attachments

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

Replies