From: "Peter Kjellerstedt" <peter.kjellerstedt@axis.com>
To: Konrad Weihmann <kweihmann@outlook.com>,
Saul Wold <Saul.Wold@windriver.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>,
"JPEWhacker@gmail.com" <JPEWhacker@gmail.com>
Subject: Re: [OE-core] [PATCH] create-spdx: Don't collect natives sources
Date: Thu, 23 Sep 2021 10:27:09 +0000 [thread overview]
Message-ID: <1d6ac5dd187543559fc07e12be5f9536@axis.com> (raw)
In-Reply-To: <AM9PR09MB4642D180F4CE760601B2A4D4A8A39@AM9PR09MB4642.eurprd09.prod.outlook.com>
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Konrad Weihmann
> Sent: den 23 september 2021 10:24
> To: Saul Wold <Saul.Wold@windriver.com>; openembedded-
> core@lists.openembedded.org; JPEWhacker@gmail.com
> Subject: Re: [OE-core] [PATCH] create-spdx: Don't collect natives sources
>
>
>
> On 23.09.21 00:14, Saul Wold wrote:
> > When the collect_dep_sources() runs, it collects sources from both
> native
> > and non-native recipes. Later when the GENERATED_FROM matching occurs it
> > may find the file (via checksum) from the native recipe since it's the
> > same checksum as the target file. The that are generated DocumentRefs
> > point to the native recipe rather than the target recipe DocumentRef.
> >
> > Signed-off-by: Saul Wold <saul.wold@windriver.com>
> > ---
> > meta/classes/create-spdx.bbclass | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-
> spdx.bbclass
> > index 3c73c21c04..8f7fae43f1 100644
> > --- a/meta/classes/create-spdx.bbclass
> > +++ b/meta/classes/create-spdx.bbclass
> > @@ -336,6 +336,10 @@ def collect_dep_sources(d, dep_recipes):
> >
> > sources = {}
> > for dep in dep_recipes:
> > + # Don't collect sources from native recipes as they
> > + # match non-native sources also.
> > + if "-native" in dep.recipe.name:
>
> That looks a bit too fuzzy to me - I would have expected
>
> if dep.recipe.name.endswith("-native"):
>
> here. Otherwise this is very prone to false positives
Absolutely. E.g., we have a recipe called crate-native-tls for
the native-tls Rust crate.
At the same time I hate all these hardcoded tests for recipe types
all over OE Core as they assume only the types that are in OE Core
exist without any (easy) way of extending the tests for non-OE Core
recipe types.
Would it instead be possible to add the is_native in do_create_spdx()
to the recipe object so that it is available here?
> > + continue
> > recipe_files = set(dep.recipe.hasFiles)
> >
> > for spdx_file in dep.doc.files:
//Peter
next prev parent reply other threads:[~2021-09-23 10:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 22:14 [PATCH] create-spdx: Don't collect natives sources Saul Wold
2021-09-23 8:23 ` [OE-core] " Konrad Weihmann
2021-09-23 10:27 ` Peter Kjellerstedt [this message]
2021-09-23 12:16 ` Joshua Watt
2021-09-23 14:02 ` Saul Wold
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=1d6ac5dd187543559fc07e12be5f9536@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=JPEWhacker@gmail.com \
--cc=Saul.Wold@windriver.com \
--cc=kweihmann@outlook.com \
--cc=openembedded-core@lists.openembedded.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 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.