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/:'
-# 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"
@@ -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}"
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.
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.)
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.
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>
---
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 am willing to flag EGO_SUM as deprecated if a variable can be flagged
as deprecated; that is what I'm looking up now.
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.
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.
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:35:22 |
Calls: | 10,397 |
Calls today: | 5 |
Files: | 14,067 |
Messages: | 6,417,401 |
Posted today: | 1 |