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 (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4C7AB158009 for ; Mon, 19 Jun 2023 15:01:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A724E0894; Mon, 19 Jun 2023 15:01:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 950FFE0869; Mon, 19 Jun 2023 15:01:14 +0000 (UTC) Message-ID: Subject: [gentoo-dev] Migrating ebuilds to "optimized" cargo.eclass API From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev-announce@lists.gentoo.org Cc: gentoo-dev@lists.gentoo.org Date: Mon, 19 Jun 2023 17:01:09 +0200 Organization: Gentoo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.3 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 X-Archives-Salt: 212c5023-156b-4ce6-8ee5-f020da843c27 X-Archives-Hash: 2c926c72a7025e4a849adb832421a441 Hi, Over the weekend, I've pushed the cargo.eclass changes that provide a more optimal (read: much faster in metadata phase) API for ebuilds.=20 However, for it to actually benefit Gentoo ebuilds need to be updated to use it. The migration requires two changes: 1. `$(cargo_crate_uris)` (or `$(cargo_crate_uris ${CRATES})`) in SRC_URI needs to be replaced by `${CARGO_CRATE_URIS}`. This requires that CRATES and GIT_CRATES are declared pre-inherit (this is already enforced for CRATES in EAPI 8, but it is not for GIT_CRATES). 2. The CRATES variable (and other crate lists) need to use `@` as the separator between crate name and version instead of `-`. The easiest way to do this is to use >=3Dapp-portage/pycargoebuild-0.7 to generate the variable. You can use the in-place mode to update the ebuild, then it will substitute the list in place: pycargoebuild -i foo-1.2.3.ebuild /directories/with/cargo-lock Note that pycargoebuild won't replace $(cargo_crate_uris) automatically though. --=20 Best regards, Micha=C5=82 G=C3=B3rny