public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev-announce@lists.gentoo.org
Cc: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Migrating ebuilds to "optimized" cargo.eclass API
Date: Mon, 19 Jun 2023 17:01:09 +0200	[thread overview]
Message-ID: <a392a6ec1f1cdeecbb84b2949978f6c67753292f.camel@gentoo.org> (raw)

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



             reply	other threads:[~2023-06-19 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 15:01 Michał Górny [this message]
2023-06-24 14:45 ` [gentoo-dev] Re: [gentoo-dev-announce] Migrating ebuilds to "optimized" cargo.eclass API Arthur Zamarin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a392a6ec1f1cdeecbb84b2949978f6c67753292f.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev-announce@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox