All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul Barker" <paul@pbarker.dev>
To: "Marco Felsch" <m.felsch@pengutronix.de>,
	<openembedded-core@lists.openembedded.org>
Cc: <peter.kjellerstedt@axis.com>, <yocto@pengutronix.de>
Subject: Re: [PATCH v3] classes/cargo-update-recipe-crates: support multiple Cargo.lock search directories
Date: Thu, 26 Nov 2026 09:17:23 +0000	[thread overview]
Message-ID: <DN512WUV1N5T.37DXG9FP6FCI6@pbarker.dev> (raw)
In-Reply-To: <20261126-mfe-multi-cargo-lock-files-v3-1-7ee885214204@pengutronix.de>

On Thu Nov 26, 2026 at 8:37 AM GMT, Marco Felsch wrote:
> Recipes using cargo's -Z build-std must also vendor the standard
> library's dependencies. The std sources staged by rust-native
> (.../rustlib/src/rust/library) ship a Cargo.lock but no vendor
> directory, so those crates need crate:// entries in SRC_URI as well.
> Until now only a single directory could be scanned (CARGO_LOCK_SRC_DIR),
> which forced the std crate list to be maintained by hand and go stale on
> toolchain upgrades, breaking do_compile with:
>
>   error: failed to select a version for the requirement
>   `cfg-if = "^1.0"` (locked to 1.0.4)
>
> Keep the existing CARGO_LOCK_SRC_DIR and extend it to support a
> space-separated list of directories, to allow:
>
>   CARGO_LOCK_SRC_DIR = "${S} ${STAGING_LIBDIR_NATIVE}/rustlib/src/rust/library"
>
> This way the behavior can be backported.
>
> Crates found in multiple lockfiles are listed only once, in the section
> of the first Cargo.lock containing them; conflicting checksums for the
> same crate version now fail the task. The crates.io warning now names the
> lockfile it came from. Output for recipes with a single lockfile is
> unchanged.
>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> Hi,
>
> this patch adds the support to reference multiple Cargo.lock files which
> is handy once a recipe want to rebuild the std-crate for minimized
> special purpose builds.
> ---
> Changes in v3:
> - Link to v2: https://lore.kernel.org/r/20261124-mfe-multi-cargo-lock-files-v2-1-8fd15cf316aa@pengutronix.de
> - Convert to space-separated list to simplify :remove handling and align
>   with standard bitbake behavior
>
> Changes in v2:
> - Link to v1: https://lore.kernel.org/r/20261021-mfe-multi-cargo-lock-files-v1-0-d3510d4ad963@pengutronix.de
> - Drop mainlined fixes patch
> - Re-use CARGO_LOCK_SRC_DIR to make it backportable
> - Add support for v1 Cargo.lock file format
> ---
>  .../cargo-update-recipe-crates.bbclass             | 87 ++++++++++++++++------
>  1 file changed, 65 insertions(+), 22 deletions(-)
>
> diff --git a/meta/classes-recipe/cargo-update-recipe-crates.bbclass b/meta/classes-recipe/cargo-update-recipe-crates.bbclass
> index 0767b566ee287d11dc2e1e6d0aeea0a0d3b225b8..092dce21fe27bd1c693e8e68c4d6405ad2f03c71 100644
> --- a/meta/classes-recipe/cargo-update-recipe-crates.bbclass
> +++ b/meta/classes-recipe/cargo-update-recipe-crates.bbclass
> @@ -9,6 +9,10 @@
>  ## This class is used to update the list of crates in SRC_URI
>  ## by reading Cargo.lock in the source tree.
>  ##
> +## Both the current Cargo.lock format (checksum stored per [[package]])
> +## and the old v1 format (checksums stored in the [metadata] table as
> +## "checksum <name> <version> (<source>)" checksum-val) are supported.

Hi,

It looks like this patch is making two changes at once: Adding support
for multiple Cargo.lock dirs and adding support for multiple Cargo.lock
format versions. There's no mention of the second change in the commit
message.

This would be better as two separate patches.

Best regards,

-- 
Paul Barker


  reply	other threads:[~2026-11-26  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  8:37 [PATCH v3] classes/cargo-update-recipe-crates: support multiple Cargo.lock search directories Marco Felsch
2026-11-26  9:17 ` Paul Barker [this message]
2026-11-26  9:51   ` Marco Felsch
2026-11-27 12:25 ` [OE-core] " Antoine Lubineau
2026-11-28 13:58   ` Marco Felsch

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=DN512WUV1N5T.37DXG9FP6FCI6@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=m.felsch@pengutronix.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.com \
    --cc=yocto@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.