public inbox for gentoo-dev-announce@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev-announce] Migrating ebuilds to "optimized" cargo.eclass API
@ 2023-06-19 15:01 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2023-06-19 15:01 UTC (permalink / raw
  To: gentoo-dev-announce; +Cc: gentoo-dev

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. 
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 >=app-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.

-- 
Best regards,
Michał Górny



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-19 15:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19 15:01 [gentoo-dev-announce] Migrating ebuilds to "optimized" cargo.eclass API 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