• [gentoo-dev] [PATCH v2] go-module.eclass: deprecate EGO_SUM and call eg

    From William Hubbs@21:1/5 to All on Sun Feb 27 05:40:01 2022
    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 <williamh@gentoo.org>
    ---
    eclass/go-module.eclass | 144 +++++++++++-----------------------------
    1 file changed, 38 insertions(+), 106 deletions(-)

    diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
    index 66fe52c9ad7..b9686ad555a 100644
    --- a/eclass/go-module.eclass
    +++ b/eclass/go-module.eclass
    @@ -25,9 +25,26 @@
    #
    # 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-vendor.tar.xz vendor --xform 's:^":project-1.0/:'
    +#
    +# @CODE
    +#
    +# Note that 'go mod vendor' drops files from the dependency tree, and
    +# this causes errors with some builds. If your
  • From Ionen Wolkens@21:1/5 to William Hubbs on Sun Feb 27 06:50:01 2022
    On Sat, Feb 26, 2022 at 10:38:33PM -0600, William Hubbs wrote:
    diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
    index 66fe52c9ad7..b9686ad555a 100644
    --- a/eclass/go-module.eclass
    +++ b/eclass/go-module.eclass
    @@ -25,9 +25,26 @@
    #
    # 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

    Unnecessary double space.

    +# 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-vendor.tar.xz vendor --xform 's:^":project-1.0/:'

    Typo, that " doesn't exist at start of paths and it'd do nothing.
    Should just be 's:^:project-1.0/:'

    -# SRC_URI="https://github.com/example/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
    -# ${EGO_SUM_SRC_URI}"
    +# SRC_URI="https://github.com/example/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
    +# Do not add the next line if you don't have a vendor tarball
    +# SRC_URI+="${P}-vendor.tar.gz"

    Since example use .xz, should use it over .gz for vendor tarball.

    @@ -256,7 +197,7 @@ go-module_set_globals() {
    # Relative URI within a GOPROXY for a file
    _reluri="${_dir}/@v/${version}.${_ext}"
    # SRC_URI: LHS entry
    - _uri="${_GOMODULE_GOPROXY_BASEURI}/${_reluri}"
    + _uri="mirror://goproxy/${_reluri}"
    # _uri="mirror://goproxy/${_reluri}"

    Unnecessary comment that duplicates the now-used above line.

    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmIbEBgACgkQskQGsLCs QzRaGgf/cW9lK+8mbXBC+1eZ7yU6IdLl5LBfvYFzmvOmtQyRXnnQpRJnay8A8tNP /kYrlE4n1b55Nb/HXPY7iNOefXhYisB9gEzm2BvZU/W5rxdPP1cZKZl9xLoX5N4r MeER5NNIjx619uAd32kqRLMniQP+2C7ZKLeF9F0ofB6z+LnlGG1dVLtlmIL9Q58Z 7kZJ/14GM7Its1WzpWolTNoBd7NormezqU8NIAZTV/PhUeixTjNI7J1eCAQOFiVf mc4ciFgOztMKbZ+SEQ+p3732+z34FFHd9M6uwZbqUTPhGO9/IHAOl+o8EY6u2eg2 9pXM3Bid8l/qx1IaZHV0MZphnOb2wA==
    =GvVK
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sun Feb 27 12:20:01 2022
    On Sun, 27 Feb 2022, Ionen Wolkens wrote:

    On Sat, Feb 26, 2022 at 10:38:33PM -0600, William Hubbs wrote:
    +# eclass. If it doesn't, you need to also create a vendor tarball and

    Unnecessary double space.

    No. It is a sentence end, so the double space is mandatory.

    (The reason is that we generate manpages from eclass documentation,
    so we should follow groff conventions for sentence ends.)

    Ulrich

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmIbXdkPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uXfsIAIj2tlAiK96MerOA6cu0vc1T5CEFAVamobQ9 ekRlM2BSmZu0Hws15AIvtWY+OeVFmxb9qvCOia6LaHfJDXmKl23ncv8eskDGK1ee qo3iKi5+ApXi4LBlquJMzZ2hXEoEFf8227KTt3duExA08ZH3ImgcO+vJW04KjEUE aRyHtfpJeAselMf/juLccgV954iKkTMFdZgV7JLUUDxnA1FRqfanyNETLtixbEDi i+wDzeF9D+hwB8cvvEqdVkDWSyocS7HWnrwzHEOuXN22NofdrWfe2n/0rV1KY+o2 0sY1KdGRmyTK0AoRFe4HSHsqyoEfIVLrklW6/u40Ayht/vcHq1w=
    =0Enb
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to Ulrich Mueller on Sun Feb 27 19:30:01 2022
    On Sun, Feb 27, 2022 at 12:17:45PM +0100, Ulrich Mueller wrote:
    On Sun, 27 Feb 2022, Ionen Wolkens wrote:

    On Sat, Feb 26, 2022 at 10:38:33PM -0600, William Hubbs wrote:
    +# eclass. If it doesn't, you need to also create a vendor tarball and

    Unnecessary double space.

    No. It is a sentence end, so the double space is mandatory.

    (The reason is that we generate manpages from eclass documentation,
    so we should follow groff conventions for sentence ends.)

    I've never heard of this convention, and there many places in eclasses, including this one, that have a single space as a sentence end.
    that have a single space at a sentence end, so I will go ahead and fix
    this.

    William


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYhvB2wAKCRBuVBb0MMRl OGLiAJ9935whmtvY9u4moGxeYUgXuwDRHgCdEI5A4Ats+nKxdFl6n/wXYm8H+gY=
    =SCuv
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to Ionen Wolkens on Sun Feb 27 19:20:01 2022
    On Sun, Feb 27, 2022 at 12:46:00AM -0500, Ionen Wolkens wrote:
    On Sat, Feb 26, 2022 at 10:38:33PM -0600, William Hubbs wrote:
    diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
    index 66fe52c9ad7..b9686ad555a 100644
    --- a/eclass/go-module.eclass
    +++ b/eclass/go-module.eclass
    @@ -25,9 +25,26 @@
    #
    # 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

    Unnecessary double space.

    +# 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-vendor.tar.xz vendor --xform 's:^":project-1.0/:'

    Typo, that " doesn't exist at start of paths and it'd do nothing.
    Should just be 's:^:project-1.0/:'

    This is fixed.


    -# SRC_URI="https://github.com/example/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
    -# ${EGO_SUM_SRC_URI}"
    +# SRC_URI="https://github.com/example/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
    +# Do not add the next line if you don't have a vendor tarball
    +# SRC_URI+="${P}-vendor.tar.gz"

    Since example use .xz, should use it over .gz for vendor tarball.

    Fixed, but note that it doesn't really matter. you can use .z, .gz,
    .zip, or whatever you want to use.


    @@ -256,7 +197,7 @@ go-module_set_globals() {
    # Relative URI within a GOPROXY for a file
    _reluri="${_dir}/@v/${version}.${_ext}"
    # SRC_URI: LHS entry
    - _uri="${_GOMODULE_GOPROXY_BASEURI}/${_reluri}"
    + _uri="mirror://goproxy/${_reluri}"
    # _uri="mirror://goproxy/${_reluri}"

    Unnecessary comment that duplicates the now-used above line.

    This part of the eclass is out of scope for what I was changing, and
    since most of this code will go away eventually, I'm not really worried
    about this extra comment.

    William

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYhu/iQAKCRBuVBb0MMRl OPuIAKCRRhWxIOs6TTwYP3YirNTSSa1AVQCcDCVCMyuEmD6ecNlh2Mxhnf5nvSw=
    =o0f+
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Tue Mar 1 22:10:01 2022
    On 27 Feb 2022, at 04:38, William Hubbs <williamh@gentoo.org> 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 <williamh@gentoo.org>
    ---

    Per comments on IRC, I suggest not removing the EGO_SUM
    examples for now until we've got good documentation and tooling
    for vendor stuff, and a transition period is completed.

    We can do it in a little bit but let's not add the new thing and remove
    the old one in the same swoop.

    Best,
    sam

    -----BEGIN PGP SIGNATURE-----

    iQGTBAEBCgB9FiEEYOpPv/uDUzOcqtTy9JIoEO6gSDsFAmIeijhfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYw RUE0RkJGRkI4MzUzMzM5Q0FBRDRGMkY0OTIyODEwRUVBMDQ4M0IACgkQ9JIoEO6g SDv7pQf+O7Bwd4fShTB8aCBBeFsY1/CAsZS5Hz8XVqg1+v7IgNMAlCFl/km15hup uDGFyI1KdKm5lZPNcYEQ1pnHKSjXddV+fKyeft5II+TDtTHzrGv0BetbpThO0kSR lNYjyysWLFMSBzLLh/xu35hcKIYLWDXRHjG3zAAx8rNJOBng4sDXD7kZDP/anMDl qze5kjwsMKXC1rO90e0okZEBOSERFYWlnznW+34AuI7x9+oc/ChfmLyaRqNA6Baf ZUljepr/mwSMhzkRaWl0hNDTet2a6+tqmm0Cab9h9RIsMy7pR+zyTG05kqmWx6bz +hJhsaNkPx1/GjZF/Um4LlWSWtARhA==
    =EqCb
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to Sam James on Tue Mar 1 23:00:01 2022
    On Tue, Mar 01, 2022 at 09:03:52PM +0000, Sam James wrote:


    On 27 Feb 2022, at 04:38, William Hubbs <williamh@gentoo.org> 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 <williamh@gentoo.org>
    ---

    Per comments on IRC, I suggest not removing the EGO_SUM
    examples for now until we've got good documentation and tooling
    for vendor stuff, and a transition period is completed.

    I would rather not keep the EGO_SUM documentation. I do not want any
    new ebuilds coming into the tree using it.

    I am willing to flag EGO_SUM as deprecated if a variable can be flagged
    as deprecated; that is what I'm looking up now.

    William

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYh6WTAAKCRBuVBb0MMRl OLxQAJ0VydBfXZMqIcd8JymzAAkCw8u2jgCgpotQs0OwBW2xdxS87Ay3sXPM65g=
    =PiD2
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anna Vyalkova@21:1/5 to William Hubbs on Wed Mar 2 17:40:01 2022
    On 2022-03-01 15:55, William Hubbs wrote:
    I am willing to flag EGO_SUM as deprecated if a variable can be flagged
    as deprecated; that is what I'm looking up now.

    EGO_SUM is often the only choice for overlays, so consider not
    deprecating it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Fri Mar 4 01:10:01 2022
    On 4 Mar 2022, at 00:00, William Hubbs <williamh@gentoo.org> wrote:

    On Wed, Mar 02, 2022 at 09:32:14PM +0500, Anna Vyalkova wrote:
    On 2022-03-01 15:55, William Hubbs wrote:
    I am willing to flag EGO_SUM as deprecated if a variable can be flagged
    as deprecated; that is what I'm looking up now.

    EGO_SUM is often the only choice for overlays, so consider not
    deprecating it.

    EGO_SUM does not work for large SRC_URI; that is the reason it is
    being deprecated.

    Also, my understanding is we do not normally keep code around
    if that code's only purpose is to support overlays.

    I don't think there's a need to rip it out given we know it can be quite
    useful there though, right?

    It's not actively harming anything to just keep the small amount of code there.

    I think it's quite a nice convenience option (in fact, for ::gentoo too), where EGO_SUM isn't huge. But I admit this isn't that common.

    As for the series: as per commits on IRC: fine to compromise on you
    removing it now, but please do in two separate commits so it's more
    obvious in the git history. But that's notwithstanding possibly keeping it
    for overlays.

    -----BEGIN PGP SIGNATURE-----

    iQGTBAEBCgB9FiEEYOpPv/uDUzOcqtTy9JIoEO6gSDsFAmIhVuZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYw RUE0RkJGRkI4MzUzMzM5Q0FBRDRGMkY0OTIyODEwRUVBMDQ4M0IACgkQ9JIoEO6g SDvrZAgAnJ/7IxLbpVWwfCcxE1/7ydO4k/M1KphLDk2XNWBdPCsEyP1cgloBqAQt 0JwH5aWV+ukE8rMYnsmKHIsOVgLFSw8DFpsxRnF+ngSwTnQ5bR76jAGAqWm/V7w3 qFkt0bLL3EmXvE17YNv5FDFIaTneutafjX9m7RIZqHniqgjUH7u4GMJCSw8lkb7M d+PBlLy7fRR5G/7UKqO8JhMPWRjMmTCuvs25fp7Njg93CqKFK9sMZx0tZLBsrQRI NomyOzzYGYHTgu+dDbaR5S2XFBwjAnSl4R0TPhE7rvlSVcxCq8xBldWziLHbKrX+ 90353Y/4ctqC/wtVYNV/Gw+zNPZpgg==
    =VvOb
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to Anna Vyalkova on Fri Mar 4 01:10:01 2022
    On Wed, Mar 02, 2022 at 09:32:14PM +0500, Anna Vyalkova wrote:
    On 2022-03-01 15:55, William Hubbs wrote:
    I am willing to flag EGO_SUM as deprecated if a variable can be flagged
    as deprecated; that is what I'm looking up now.

    EGO_SUM is often the only choice for overlays, so consider not
    deprecating it.

    EGO_SUM does not work for large SRC_URI; that is the reason it is
    being deprecated.

    Also, my understanding is we do not normally keep code around
    if that code's only purpose is to support overlays.

    Thanks,

    William


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYiFWfgAKCRBuVBb0MMRl OJUKAJ9v+SQhS6YZKgaD+P0oGITbm0eZYACgn1Lf5N4OeRKRr1gZmrzd5XQW+uE=
    =DxbH
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to Sam James on Fri Mar 4 03:00:01 2022
    On Fri, Mar 04, 2022 at 12:01:42AM +0000, Sam James wrote:


    On 4 Mar 2022, at 00:00, William Hubbs <williamh@gentoo.org> wrote:

    On Wed, Mar 02, 2022 at 09:32:14PM +0500, Anna Vyalkova wrote:
    On 2022-03-01 15:55, William Hubbs wrote:
    I am willing to flag EGO_SUM as deprecated if a variable can be flagged >>> as deprecated; that is what I'm looking up now.

    EGO_SUM is often the only choice for overlays, so consider not
    deprecating it.

    EGO_SUM does not work for large SRC_URI; that is the reason it is
    being deprecated.

    Also, my understanding is we do not normally keep code around
    if that code's only purpose is to support overlays.

    I don't think there's a need to rip it out given we know it can be quite useful there though, right?

    It's not actively harming anything to just keep the small amount of code there.

    Sure, it may not be harmful to keep it there, but using it in the main
    tree isn't going to be a thing.

    I think it's quite a nice convenience option (in fact, for ::gentoo too), where
    EGO_SUM isn't huge. But I admit this isn't that common.

    Another thing to consider is that the bulk of the code in the eclass is
    for handling EGO_SUM, so if I can remove it, ultimately, it will mean less code to maintain.

    I will post a separate patch which I will not merge at this point to
    show what I'm talking about.

    Thanks,

    William

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYiFyVwAKCRBuVBb0MMRl OO5IAJ9S9yqcSel6xvy4pkgxe+LgUQeYCACgmEG/O1jJUEngC7Ga7kV3qez7+2c=
    =xoP5
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)