Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Benjamin Robin <benjamin.robin@bootlin.com>
To: openembedded-core@lists.openembedded.org,
	Paul Barker <paul@pbarker.dev>,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: jpewhacker@gmail.com, antonin.godard@bootlin.com,
	mathieu.dubois-briand@bootlin.com, thomas.petazzoni@bootlin.com,
	daniel.turull@ericsson.com
Subject: Re: [OE-core] [PATCH 2/2] package: fix source path in save_debugsources_info()
Date: Sat, 22 Aug 2026 11:49:44 +0200	[thread overview]
Message-ID: <1OMpr5mbRGa64B_8cFNdPw@bootlin.com> (raw)
In-Reply-To: <c74cc8fd01dff0446c6d7a06eecea7efcbe31295.camel@linuxfoundation.org>

On Thursday, August 20, 2026 at 4:14 PM, Richard Purdie wrote:
> On Sun, 2026-08-16 at 14:19 +0200, Benjamin Robin via lists.openembedded.org wrote:
> > On Sunday, August 16, 2026 at 1:37 PM, Paul Barker wrote:
> > > On Sun, 2026-08-16 at 13:25 +0200, Benjamin Robin wrote:
> > > > On Sunday, August 16, 2026 at 1:12 PM, Benjamin Robin wrote:
> > > > > On Sunday, August 16, 2026 at 12:46 PM, Paul Barker wrote:
> > > > > > On Mon, 2026-08-10 at 09:11 +0200, Benjamin Robin wrote:
> > > > > > The paths in ${PN}-debugsources.json currently match where the files
> > > > > > will be installed on the target. If we change these to be relative
> > > > > > paths within ${UNPACKDIR} then we would break other ways that the
> > > > > > debugsources json files may be used.
> > > > > 
> > > > > Hello Paul,
> > > > > 
> > > > > This was never the purpose of ${PN}-debugsources.json if I am not mistaken.
> > > > > If you look at the code (before my patches) the path should have been
> > > > > modified to be somewhat relative to WORKDIR. But the code had a bug, and
> > > > > the paths were never modified.
> > > > > 
> > > > > Also, for the kernel, the kernel sources paths were already modified to be
> > > > > the same as the path in SPDX, so starting with ${BP}. This part was
> > > > > mostly working for the "main" use case. In a previous RFC series that was
> > > > > merged, I fix that to be working for any kernel recipe.
> > > > >  
> > > > > > What is currently broken? 
> > > > > 
> > > > > SPDX_INCLUDE_COMPILED_SOURCES for a normal recipe (not the kernel) is not
> > > > > working.
> > > > > 
> > > > > > Can this be fixed at the point where the
> > > > > > debugsources json file is parsed instead of where it is generated?
> > > > 
> > > > Yes, I guess we could modify how oe.spdx_common.get_compiled_sources() is
> > > > implemented. In that case I would recommend to no longer modify the paths
> > > > of kernel sources in save_debugsources_info(). We would keep the paths as is,
> > > > we would only filter for "<internal>", "<built-in>", ...
> > > > 
> > > > In any cases, this is kind of a breaking change since the
> > > > ${PN}-debugsources.json is not going to contain the same paths as before.
> > > > 
> > > > But what you are "proposing" (modifying get_compiled_sources()) is a bit
> > > > cleaner from my point of view. This is a bit more work, that is why I did
> > > > not do that.
> > > > Joshua do you have an option on that?
> > > > 
> > > > > > Sorry if I'm missing some context here.
> > > > > 
> > > > > For the full context see:
> > > > > https://lore.kernel.org/all/20260727-fix-get-patched-src-v1-0-f5054ca10e14@bootlin.com/
> > > > > https://github.com/bootlin/yocto-kiss/pull/26#discussion_r3626224833
> > > 
> > > Hi Benjamin,
> > > 
> > > Yes, I was missing some context! I was replying based off discussions we
> > > had on the patch review call on Thursday.
> > > 
> > > If the paths in debugsources.json files are currently inconsistent
> > > between kernel and non-kernel recipes then we should fix that. So
> > > perhaps your patch is correct after all. I'll let Joshua give an
> > > opinion.
> > 
> > Be aware that with all my patches, the content of debugsources.json will
> > still contain paths starting with /usr/src/debug/ since there are paths
> > from others recipes (header files from glibc for example, ...).
> > 
> > I am not sure I will have time this week to take a look at the second
> > solution (modifying get_compiled_sources which is a bit cleaner from my
> > point of view). I'll let Joshua give his opinion first :)
> 
> Giving some extra data here, we list all the sources the binaries
> reference, whether they're from the current recipe or a different one.
> The sources from a different recipe use the on target paths for the
> soruces and I think the paths for the current recipe should be the same
> for consistency.
> 
> The /usr/src/debug/ paths are therefore correct and we should be
> standarising on that, not on transient build paths IMO.
> 
> If other code has to resolve that to find the real files, so be it.
> That will depend on the context the file is being used in as to whether
> they're even still available.

Hello Richard,

I sent a v2 with a cleaner approach:
 - No longer modify paths in debugsources.json.zstd
 - The logic is now in oe.spdx_common.get_compiled_sources() 

-- 
Benjamin Robin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com





      reply	other threads:[~2026-08-22  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10  7:11 [PATCH 0/2] package: improve save_debugsources_info() Benjamin Robin
2026-08-10  7:11 ` [PATCH 1/2] package: Fix source info when PACKAGE_DEBUG_STATIC_SPLIT is set Benjamin Robin
2026-08-10  7:11 ` [PATCH 2/2] package: fix source path in save_debugsources_info() Benjamin Robin
2026-08-16 10:46   ` Paul Barker
2026-08-16 11:12     ` Benjamin Robin
2026-08-16 11:25       ` Benjamin Robin
2026-08-16 11:37         ` Paul Barker
2026-08-16 12:19           ` Benjamin Robin
2026-08-20 14:14             ` [OE-core] " Richard Purdie
2026-08-22  9:49               ` Benjamin Robin [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=1OMpr5mbRGa64B_8cFNdPw@bootlin.com \
    --to=benjamin.robin@bootlin.com \
    --cc=antonin.godard@bootlin.com \
    --cc=daniel.turull@ericsson.com \
    --cc=jpewhacker@gmail.com \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul@pbarker.dev \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=thomas.petazzoni@bootlin.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