• [gentoo-dev] [PATCH v5] go-module.eclass: deprecate EGO_SUM

    From William Hubbs@21:1/5 to All on Sat Mar 5 23:20: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 dependency tarballs are a better solution if
    upstream doesn't vendor their dependencies.

    Signed-off-by: William Hubbs <williamh@gentoo.org>
    ---
    eclass/go-module.eclass | 45 ++++++++++++++++++++++++++++++-----------
    1 file changed, 33 insertions(+), 12 deletions(-)

    diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
    index 635d2b5161a..2d42758c6f4 100644
    --- a/eclass/go-module.eclass
    +++ b/eclass/go-module.eclass
    @@ -25,8 +25,20 @@
    #
    # 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 dependency tarball and
    +# host it somewhere, for example in your dev space.
    +#
    +# Here is an example of how to create a dependency tarball.
    +# The base directory in the GOMODCACHE setting must be go-mod in order
    +# to match the settings in this eclass.
    +#
    +# @CODE
    +#
    +# $ cd /path/to/project
    +# $ GOMODCACHE="${PWD}"/go-mod go mod download -modcacherw
    +# $ tar -acf project-1.0-deps.tar.xz go-mod
    +#
  • From Sam James@21:1/5 to All on Sun Mar 6 01:20:01 2022
    On 5 Mar 2022, at 22:17, 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 dependency tarballs are a better solution if
    upstream doesn't vendor their dependencies.

    Signed-off-by: William Hubbs <williamh@gentoo.org>
    ---
    eclass/go-module.eclass | 45 ++++++++++++++++++++++++++++++-----------
    1 file changed, 33 insertions(+), 12 deletions(-)

    lgtm

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

    iQGTBAEBCgB9FiEEYOpPv/uDUzOcqtTy9JIoEO6gSDsFAmIj/RtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYw RUE0RkJGRkI4MzUzMzM5Q0FBRDRGMkY0OTIyODEwRUVBMDQ4M0IACgkQ9JIoEO6g SDu6hAf+PDX6cXRuoueEfiQT+IecujoneDdVFuzVDFJzSCpLnvbklASC5prUwipd sGXT8b1IdjScLIk2JZRic9ZFeNwa3GqR7WzDpA/a3j/cjaohIoIDJxOX92qPJBvV y0Okcxs23SnclKtlEoDY4/2IRTxTR3gvs3+m3JvRx1tK6bzsTQYHg1EJm1a9BR4R gI/jD4TQPSifFul/RjwBVEvOli6movI6sjw3GIx4tjety5XsW4bl+MtVPGgVvxTu ZN9FMa1Sso0T2wcZOLBneKGyywcaLFm0ZP10ccypnRekOMetHThdTOnGlco/8ey7 vkwFnjdCGJGDTG6bsZRi53/ey6Nz5Q==
    =swo1
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Sun Mar 6 10:30:01 2022
    On 5 Mar 2022, at 22:17, 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 dependency tarballs are a better solution if
    upstream doesn't vendor their dependencies.

    Signed-off-by: William Hubbs <williamh@gentoo.org>
    ---
    [snip]

    -#
    -# 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"
    +# Add this line if you have a dependency tarball.
    +# SRC_URI+=" ${P}-dep.tar.xz"

    In #gentoo-dev-help, Weiss-Fder[m] pointed out this should be 'deps'.

    Best,
    sam

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

    iQGTBAEBCgB9FiEEYOpPv/uDUzOcqtTy9JIoEO6gSDsFAmIkfMNfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYw RUE0RkJGRkI4MzUzMzM5Q0FBRDRGMkY0OTIyODEwRUVBMDQ4M0IACgkQ9JIoEO6g SDvdRgf/adqJt6euMzC+eOpXXMpZtupSyzLnoFu3ci2ail0aqnnG59SvsuXUPk4N Nd+P2rpQ2HGpoewyBPx4wrCBEWl1Go/qrZTa/3oqpeJhdAiMznicyYbUtFK5SeZT iQPg7n7MOGu2CXqdaMsfL5T04JXCclCrtWMggIBjvU1rXdCQ2VJBkFpWHV5onz1X XZfaYR4zqYiR+NqTlSnUtxGhHJzqM/m0HixjpAakma6h4mlOjbAuKkT87rezkyst Sv2dv9a9yRMnRE9GnWqk0Yz7M3/J2z2Ts7+Ej7m3JXVVkA6VYFEVm9HHwePRa8jV FAJtip52ClbQ3eLzKLkXKnvfl+CRYQ==
    =viL3
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to Sam James on Sun Mar 6 16:20:02 2022
    On Sun, Mar 06, 2022 at 09:20:03AM +0000, Sam James wrote:


    On 5 Mar 2022, at 22:17, 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 dependency tarballs are a better solution if
    upstream doesn't vendor their dependencies.

    Signed-off-by: William Hubbs <williamh@gentoo.org>
    ---
    [snip]

    -#
    -# 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"
    +# Add this line if you have a dependency tarball.
    +# SRC_URI+=" ${P}-dep.tar.xz"

    In #gentoo-dev-help, Weiss-Fder[m] pointed out this should be 'deps'.

    This is fixed and the patch is merged.

    Thanks,

    William

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

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYiTO0wAKCRBuVBb0MMRl OHd7AJ9gweoB5+ChuRYYVbi9F0mIPSaZTgCcDGyLxXDaEq3m75c7j0UhEguO3Ys=
    =2YWl
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tastytea@21:1/5 to williamh@gentoo.org on Mon Mar 7 13:20:01 2022
    On 2022-03-05 16:17-0600 William Hubbs <williamh@gentoo.org> wrote:

    +# @CODE
    +#
    +# $ cd /path/to/project
    +# $ GOMODCACHE="${PWD}"/go-mod go mod download -modcacherw
    +# $ tar -acf project-1.0-deps.tar.xz go-mod

    What's the reason to use `go mod download` here and not `go mod
    vendor`? The former seems to always generate much bigger directories.
    For www-apps/hugo it is 1.5G vs. 65M and someone on IRC mentioned that
    for another ebuild it is >600M vs 22M.

    Kind regards, tastytea

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Hubbs@21:1/5 to tastytea on Thu Mar 10 17:10:01 2022
    On Mon, Mar 07, 2022 at 01:10:46PM +0100, tastytea wrote:
    On 2022-03-05 16:17-0600 William Hubbs <williamh@gentoo.org> wrote:

    +# @CODE
    +#
    +# $ cd /path/to/project
    +# $ GOMODCACHE="${PWD}"/go-mod go mod download -modcacherw
    +# $ tar -acf project-1.0-deps.tar.xz go-mod

    What's the reason to use `go mod download` here and not `go mod
    vendor`? The former seems to always generate much bigger directories.
    For www-apps/hugo it is 1.5G vs. 65M and someone on IRC mentioned that
    for another ebuild it is >600M vs 22M.

    You are correct, it does generate bigger directories. "go mod vendor"
    doesn't preserve everything needed to make some builds happen, so I had
    to go with "go mod download". For more info, see the following upstream
    issue (note that several folks have asked for the discussion to be
    restarted; I haven't seen any responses yet).

    http://github.com/golang/go/issues/26366

    Thanks,

    William

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

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYioiRwAKCRBuVBb0MMRl OARBAJ45hPCwWN/yq0Jl9QFamKau497yWQCeIDRYlYAYr+I9nKwb9VNutC9A1aY=
    =zhjw
    -----END PGP SIGNATURE-----

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