Packages with a large number of EGO_SUM entries, i.e., many thousands,
cause SRC_URI, and in turn A, to become quite large. Prevent issues that
are caused by large environment variables, e.g., execve() errors (see
bug #719203), by ensuring that A stays below a reasonable size.
Signed-off-by: Florian Schmaus <
flow@gentoo.org>
---
eclass/go-module.eclass | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
index 8047d498b08d..88414b7e9459 100644
--- a/eclass/go-module.eclass
+++ b/eclass/go-module.eclass
@@ -377,6 +377,15 @@ _go-module_src_unpack_gosum() {
die "go-module_set_globals must be called in global scope"
fi
+ local -i a_size="${#A}"
+ # Environment variables must not exceed MAX_ARG_STRLEN (128 KiB) on
+ # Linux, or otherwise execve() may fail. Ensure that A stays below
+ # this value. See also
https://bugs.gentoo.org/719202#c16
+ if [[ ${a_size} -gt 114688 ]]; then
+ # A is larger than 112 KiB.
+ die "Size of A variable (${a_size} bytes) is too large. Please use a dependency tarball instead of EGO_SUM."
+ fi
+
local goproxy_dir="${GOPROXY/file:\/\//}"
mkdir -p "${goproxy_dir}" || die
--
2.35.1
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)