On Sat, Feb 26, 2022 at 08:25:59AM +0100, Michał Górny wrote:
> On Fri, 2022-02-25 at 20:50 -0600, William Hubbs wrote:
> > EGO_SUM can be thousands of lines long in ebuilds, and it leads to
> > creating Manifest files that are thousands of lines long.
> > It has been determined that vendor tarballs are a better solution if
> > upstream doesn't vendor their dependencies.
> > 
> > Also, call the ego helper function instead of calling go directly.
> > 
> > Signed-off-by: William Hubbs <willi...@gentoo.org>
> > ---
> >  eclass/go-module.eclass | 140 ++++++++++------------------------------
> >  1 file changed, 34 insertions(+), 106 deletions(-)
> > 
> > diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
> > index 66fe52c9ad7..7f0d766f444 100644
> > --- a/eclass/go-module.eclass
> > +++ b/eclass/go-module.eclass
> > @@ -25,8 +25,18 @@
> >  #
> >  # If the software has a directory named vendor in its
> >  # top level directory, the only thing you need to do is inherit the
> > -# eclass. Otherwise, you need to also populate
> > -# EGO_SUM and call go-module_set_globals as discussed below.
> > +# eclass.  If it doesn't, you need to also create a vendor tarball and
> > +# host it somewhere, for example in your dev space.
> > +#
> > +# Here are the commands to create a vendor tarball.
> > +#
> > +# @CODE
> > +#
> > +# $ cd /path/to/project
> > +# $ go mod vendor
> > +# $ tar -acf project-1.0.tar.xz vendor
> 
> Why not 'cd ..' first and create a tarball that doesn't require custom
> src_unpack()?  Also, shouldn't the name be 'project-1.0-vendor.tar'? 
> Also, you're mising -J.

Using -a and -J together doesn't make sense since -a uses the suffix on
the file name to determine which compressor to use.

If I change the instructions as you suggest to re-package upstream's
tarball the name wouldn't need the -vendor suffix since the tarball would be a
fork, but I'm not asking people to fork and repackage upstream's tarballs, just
the vendor folder. Fortunately, there is no reason to fork since it is very
easy to package the vendor folder with Go's tools.

To move the unpacked vendor folder to the right place, I have two
choices, src_unpack and src_prepare. Since we already have a custom
src_unpack, it is less invasive to do this there. If I use src_prepare,
it would force me to bump the eclass, which I'm not interested in doing.

William

Attachment: signature.asc
Description: PGP signature

Reply via email to