public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] cargo.eclass: Emit a warning if the package uses 300+ crates
@ 2025-01-12 12:56 Michał Górny
  2025-01-12 13:15 ` Agostino Sarubbo
  2025-01-13  9:40 ` Florian Schmaus
  0 siblings, 2 replies; 10+ messages in thread
From: Michał Górny @ 2025-01-12 12:56 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Emit a QA warning suggesting the use of crate tarball, when the package
in question uses 300 crates or more.  Such a long crate lists cause
ebuilds and Manifests to grow very fast, causing significant space
consumption on end user systems (including users who are not using
the package in question) and git history growth.  On top of that,
fetching that many crates takes significant time.

The number of 300 is pretty arbitrary, chosen approximately to match
Manifests that are over 100 KiB in size.  We should probably look into
lowering in the future, as more packages are transitioned.
---
 eclass/cargo.eclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index b1285e13a5b2..c8dd7c51bcfe 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -527,6 +527,12 @@ cargo_src_unpack() {
 		done < <(sha256sum -z "${crates[@]}" || die)
 
 		popd >/dev/null || die
+
+		if [[ ${#crates[@]} -ge 300 ]]; then
+			eqawarn "This package uses a very large number of CRATES.  Please provide"
+			eqawarn "a crate tarball instead and fetch it via SRC_URI.  You can use"
+			eqawarn "'pycargoebuild --crate-tarball' to create one."
+		fi
 	fi
 
 	cargo_gen_config
-- 
2.48.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-01-14 17:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-12 12:56 [gentoo-dev] [PATCH] cargo.eclass: Emit a warning if the package uses 300+ crates Michał Górny
2025-01-12 13:15 ` Agostino Sarubbo
2025-01-12 14:30   ` Alexey Sokolov
2025-01-12 21:20     ` Ionen Wolkens
2025-01-13  9:40 ` Florian Schmaus
2025-01-13 13:23   ` orbea
2025-01-13 16:10     ` Ionen Wolkens
2025-01-13 13:36   ` Michał Górny
2025-01-14 16:56     ` Florian Schmaus
2025-01-14 17:43       ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox