On Sun, Feb 09, 2020 at 12:31:19PM -0800, Robin H. Johnson wrote:
> EGO_SUM mode now supplements the existing EGO_VENDOR mode.
> 
> EGO_SUM should be populated by the maintainer, directly from the go.sum
> file of the root package. See eclass and conversion example
> (dev-go/go-tour & app-admin/kube-bench) for further details.
> 
> The go-module_set_globals function performs validation of
> inputs and does die on fatal errors.
> 
> Signed-off-by: Robin H. Johnson <[email protected]>
> ---
>  eclass/go-module.eclass    | 328 +++++++++++++++++++++++++++++++++++--
>  profiles/thirdpartymirrors |   1 +
>  2 files changed, 311 insertions(+), 18 deletions(-)
> 
> diff --git eclass/go-module.eclass eclass/go-module.eclass
> index d5de5f60ccdf..b8a635d52de7 100644
> --- eclass/go-module.eclass
> +++ eclass/go-module.eclass
> @@ -4,22 +4,46 @@
>  # @ECLASS: go-module.eclass
>  # @MAINTAINER:
>  # William Hubbs <[email protected]>
> +# @AUTHOR:
> +# William Hubbs <[email protected]>
> +# Robin H. Johnson <[email protected]>
>  # @SUPPORTED_EAPIS: 7
>  # @BLURB: basic eclass for building software written as go modules
>  # @DESCRIPTION:
> -# This eclass provides basic settings and functions
> -# needed by all software written in the go programming language that uses
> -# go modules.
> +# This eclass provides basic settings and functions needed by all software
> +# written in the go programming language that uses go modules.
> +#
> +# You might know the software you are packaging uses modules because
> +# it has files named go.sum and go.mod in its top-level source directory.
> +# If it does not have these files, try use the golang-* eclasses FIRST!
> +# There ARE legacy Golang packages that use external modules with none of
> +# go.mod, go.sum, vendor/ that can use this eclass regardless.
> +#
> +# Guidelines for usage:
> +# "go.mod" && "go.sum" && "vendor/":
> +# - pre-vendored package. Do NOT set EGO_SUM or EGO_VENDOR.
> +#
> +# "go.mod" && "go.sum":
> +# - Populate EGO_SUM with entries from go.sum
> +# - Do NOT include any lines that contain <version>/go.mod
> +#
> +# "go.mod" only:
> +# - Populate EGO_VENDOR

go.mod without go.sum can mean that there are no external dependencies, so there
shouldn't be a reason to populate EGO_VENDOR in this case.

Here is a valid go.mod:

--- cut here ---
module github.com/williamh/get-ego-vendor

go 1.12
--- cut here ---

If go.mod has require lines in it and go.sum doesn't exist, this is
an issue to address upstream.

The way I see this going is to transition to EGO_SUM and
drop EGO_VENDOR. unless I'm missing something.


Thanks,

William

Attachment: signature.asc
Description: Digital signature

Reply via email to