Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Stefano Tondo <stondo@gmail.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: stefano.tondo.ext@siemens.com,
	Alexander Kanavin <alex.kanavin@gmail.com>,
	openembedded-core@lists.openembedded.org,
	bitbake-devel@lists.openembedded.org,
	Joshua Watt <JPEWhacker@gmail.com>,
	Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>,
	Peter Marko <peter.marko@siemens.com>,
	Adrian Freihofer <adrian.freihofer@siemens.com>,
	Patrick Wicki <patrick.wicki@siemens.com>
Subject: Re: [RFC] spdx30: name, version and purl for dependency downloads
Date: Tue, 10 Nov 2026 22:59:35 +0100	[thread overview]
Message-ID: <20261110215935.107339-1-stondo@gmail.com> (raw)
In-Reply-To: <87910dcc110b0e4cc397d9f57d9b37824c6859f2.camel@linuxfoundation.org>

Hi Richard, hi Alex,

Thank you both for the feedback. Your replies point in the same
direction, so I answer them together here.

On Fri, 6 Nov 2026 at 12:04, Alexander Kanavin wrote:
> - do not make fetchers any more complex than they already are.
> [...] Rather try to do as much as possible in oe-core through a
> clear API.

On Fri, 6 Nov 2026 at 12:17, Richard Purdie wrote:
> I think that the fetcher is the right place to do this as I would
> be very much against poking fetcher internals from OE-Core. We need
> to declare and document the stage at which this is expected to work
> (i.e. before/after fetch, before/after unpack).
> [...]
> It should probably return structured data including the purl from
> some new API.

I think these two points fit together. The fetchers already parse the
name and the version of each dependency for their own use. The new
API only returns that data as a documented structure, with the purl.
It does not change the fetch or the unpack. oe-core then writes
the SPDX from it and does not read any fetcher internals.

About the stage: crate, gomod and npmsw know the identity when they
create the FetchData. That is before fetch, and it needs no network
access. npmsw only reads its shrinkwrap file, which is a local file
in the layer. gitsm is the exception, because it can list the
submodules only from the clone. When the submodules are in SRC_URI,
that exception goes away. So I propose to document "before fetch".

> I am thinking we should change the fetcher so all the submodule urls
> are included in SRC_URI in future and expanded_urldata() goes away.
> We need to update the other backends to match. I have no knowledge
> of npm so that one will be hard for me.

Alex wrote:
> - gitsm and npmsw are historical mistakes, however 'convenient' they
> may be. [...] I would want to replace them with flat, explicit
> implementations.

I agree, and I would like to help with npm. My idea is to follow
cargo-update-recipe-crates and go-mod-update-modules: an update class
writes one SRC_URI entry with a checksum for each package in the
shrinkwrap file. Then bitbake checks that the list matches the
shrinkwrap file, as you said in your reply. Is
that what you have in mind? If yes, I can prepare patches.

This also makes my RFC smaller. Its first part records implicit
downloads. With flat SRC_URI lists, there are no implicit downloads
left to record.

> We should revisit that and fix it as I think it exposes general
> bugs.

I can investigate this too. I have a reproducer that fails every time:
meta-selftest's git-submodule-test with a named SRCREV. The bug I
found is in Fetch.localpath() for a URL that is not in SRC_URI. It
creates a new FetchData with the recipe datastore, which does not
have the SRCREV that gitsm set for the submodule. Is this the bug you
mean, or do you know of others in this area? I can start from any
cases you have.

> If the fetcher can conform to our APIs and roughly follow how
> rust/crates are working today, I think those would be fine,
> particularly if we have good tests too.

Thanks, that is clear. I will come back to new fetchers only after
we agree on the API.

Joshua, Richard deferred question d) to you. In short: a lock file
lists packages for all platforms, so the fetcher downloads some
dependencies that are never built for the target. I proposed to take
the declared scope from the lock file in the fetcher, and the
observed scope from the language classes (for example cargo metadata
--filter-platform). Does that split work for you? And how do you want
"fetched but not built" to look in SPDX 3.0?

For the next step: crate and gomod already list every dependency in
SRC_URI, so the identity API can work for them now. Do you want me to
send patches for these two, with tests, and add npm after the
flattening? Or do you prefer that I wait for Joshua's answer first?

Thanks,
Stefano

  reply	other threads:[~2026-11-10 21:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 12:21 [RFC] spdx30: name, version and purl for dependency downloads Stefano Tondo
2026-11-05 20:26 ` Alexander Kanavin
2026-11-05 21:05   ` Stefano Tondo
2026-11-06 12:04     ` Alexander Kanavin
2026-11-06 12:17 ` [OE-core] " Richard Purdie
2026-11-10 21:59   ` Stefano Tondo [this message]
2026-11-10 22:53     ` Joshua Watt
2026-11-11 11:58       ` Stefano Tondo
2026-11-11 15:54         ` Joshua Watt
2026-11-11 15:48     ` Alexander Kanavin

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=20261110215935.107339-1-stondo@gmail.com \
    --to=stondo@gmail.com \
    --cc=JPEWhacker@gmail.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=alex.kanavin@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=patrick.wicki@siemens.com \
    --cc=peter.marko@siemens.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=stefan.herbrechtsmeier@weidmueller.com \
    --cc=stefano.tondo.ext@siemens.com \
    /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