All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul Barker" <paul@pbarker.dev>
To: "Marco Felsch" <m.felsch@pengutronix.de>
Cc: <openembedded-core@lists.openembedded.org>,
	<peter.kjellerstedt@axis.com>, <yocto@pengutronix.de>,
	<antoine.lubineau@tld-robotics.com>
Subject: Re: [OE-core] [PATCH v4 3/3] classes/cargo-update-recipe-crates: support multiple Cargo.lock search directories
Date: Wed, 02 Dec 2026 10:15:15 +0000	[thread overview]
Message-ID: <DNA62HRJIUZY.GGJZCI0MWYCQ@pbarker.dev> (raw)
In-Reply-To: <nbgugqz5bhez2t4qf2udqfiobe6i632r5wcvgwntoqshy73fz7@t27zyzpjxuxg>

On Tue Dec 1, 2026 at 4:25 PM GMT, Marco Felsch wrote:
> On 26-12-01 10:37, Marco Felsch wrote:
>> Hi Paul,
>> 
>> On 26-11-30 21:24, Paul Barker wrote:
>> > Hi Marco,
>> > 
>> > Thanks for the v4 series, patches 1/3 & 2/3 are good, I have a couple of
>> > comments on this one.
>
> [...]
>
>> > > 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"
>> > 
>> > In this example you'd need to ensure ${STAGING_LIBDIR_NATIVE} is
>> > populated before do_update_crates runs. It's probably worth modifying
>> > the `addtask` line so do_update_crates always runs after
>> > do_prepare_recipe_sysroot.
>> 
>> My rust package which uses this mechanism has the following line:
>> 
>> | do_update_crates[depends] += "rust-native:do_populate_sysroot"
>> 
>> I would still need this line with your proposed change, right? If this
>> is the case, what benefit would have a do_prepare_recipe_sysroot?
>
> With v5 this is fixed now. I see that {PN}:do_populate_sysroot didn't
> fixed your point. Sorry for the noise.
>
>> > We should also consider what should happen if one of these directories
>> > is missing or doesn't contain a Cargo.lock file. Should that cause an
>> > error?
>> 
>> That's a good point, it should have the same behavior as it is right now
>> with the single directory use-case:
>>  - each specified path need at least one Cargo.lock file
>>  - each specified path must exist
>>  => else an error is thrown.
>> 
>> Do you agree?
>
> I've implemented exactly this beavhior in v5. Should be fine since it
> mimics the current status.
>
>> > > 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.
>> > 
>> > The "first" Cargo.lock file mentioning a particular crate will depend on
>> > the order in which Cargo.lock files are parsed. I don't think os.walk()
>> > explores subdirectories in a deterministic order, can we modify this so
>> > that the output is deterministic?
>> 
>> Please see the mail from Antoine:
>> https://lore.kernel.org/all/CAMPh3wqn5VMvufgZyUC3+=yzm3b0n3aciiROqnTYGDcsg2wgxg@mail.gmail.com/
>> 
>> This is already a bug in the current implementation. Seems like nobody
>> cared till now. Of course we can fix this but this for sure causes
>> changes on $someSpecificHostOs. For this reason I would like to leave
>> this discussion out of this series.
>
> I've added a deterministic fixes patch to the v5.
>
> Sorry for pushing so fast, but I wanted to get this done because other
> recipes rely on this mechanism for possible static builds.

No problem, v5 looks good to me.

Best regards,

-- 
Paul Barker


      reply	other threads:[~2026-12-02 10:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 20:40 [PATCH v4 0/3] Add support for multi Cargo.lock files Marco Felsch
2026-11-30 20:40 ` [PATCH v4 1/3] classes/cargo-update-recipe-crates: use bb.warn() instead of print() Marco Felsch
2026-11-30 20:40 ` [PATCH v4 2/3] classes/cargo-update-recipe-crates: support v1 Cargo.lock format Marco Felsch
2026-11-30 20:40 ` [PATCH v4 3/3] classes/cargo-update-recipe-crates: support multiple Cargo.lock search directories Marco Felsch
2026-11-30 21:24   ` Paul Barker
2026-12-01  9:37     ` [OE-core] " Marco Felsch
     [not found]     ` <18ED17AB19C3015E.2226965@lists.openembedded.org>
2026-12-01 16:25       ` Marco Felsch
2026-12-02 10:15         ` Paul Barker [this message]

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=DNA62HRJIUZY.GGJZCI0MWYCQ@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=antoine.lubineau@tld-robotics.com \
    --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.