From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DB7EA15813A for ; Sun, 12 Jan 2025 12:56:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9CA3AE082B; Sun, 12 Jan 2025 12:56:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F2BE2E081E for ; Sun, 12 Jan 2025 12:56:46 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] cargo.eclass: Emit a warning if the package uses 300+ crates Date: Sun, 12 Jan 2025 13:56:39 +0100 Message-ID: <20250112125639.15047-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.48.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 899a78a4-4368-4747-955e-0e14a7eaa223 X-Archives-Hash: 9597762732ef88bae8d3dcf03110ee96 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