diff mbox series

[v4,1/2] strace: Append BPN to FILESPATH to help devtool

Message ID 0b67fc315b54be36e0ea82fa54bd22ff1e3d62e8.1781624800.git.liezhi.yang@windriver.com
State Changes Requested
Headers show
Series [v4,1/2] strace: Append BPN to FILESPATH to help devtool | expand

Commit Message

Robert Yang June 16, 2026, 3:51 p.m. UTC
From: Robert Yang <liezhi.yang@windriver.com>

The 'devtool finish" added 0001-Ignore-pwritev-pwrite64-tests-on-musl.patch to
strace/files rather than strace/strace

This is because the 0001-Ignore-pwritev-pwrite64-tests-on-musl.patch is a
conditional patch:

SRC_URI:append:libc-musl = "\
           file://0001-Ignore-pwritev-pwrite64-tests-on-musl.patch \
           "

So the devtool won't copy it into workspace, then bb.utils.which() can't find
it, and will return the last section in FILESPATH which is strace/files, I
can't a regular way to fix it because that's how the bb.utils.which() and
localpath works. But there a workaround, add the following line to the recipe
can fix the problem:

FILESPATH .= ":${FILE_DIRNAME}/${BPN}"

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-devtools/strace/strace_6.19.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Alexander Kanavin June 16, 2026, 4:09 p.m. UTC | #1
On Tue, 16 Jun 2026 at 17:51, Robert Yang via lists.openembedded.org
<liezhi.yang=windriver.com@lists.openembedded.org> wrote:
> +# To help "devtool finish" can add 0001-Ignore-pwritev-pwrite64-tests-on-musl.patch
> +# into strace/strace rather than strace/files.
> +FILESPATH .= ":${FILE_DIRNAME}/${BPN}"

I'm afraid I have to disagree with this. Devtool does have support for
conditional patches as seen here:

====
alex@Zen2:/srv/storage/alex/yocto/build-riscv64$ devtool modify strace
...
INFO: SRC_URI contains some conditional appends/prepends - will create
branches to represent these
...
WARNING: SRC_URI is conditionally overridden in this recipe, thus
several devtool-override-* branches have been created, one for each
override that makes changes to SRC_URI. It is recommended that you
make changes to the devtool branch first, then checkout and rebase
each devtool-override-* branch and update any unique patches there
(duplicates on those branches will be ignored by devtool
finish/update-recipe)
...

alex@Zen2:/srv/storage/alex/yocto/build-riscv64/workspace/sources/strace$
git branch
* devtool
  devtool-no-overrides
  devtool-override-libc-musl
  master
====

so this strace issue is hitting a bug in that conditional patch
support. Rather, it should be investigated why is devtool writing out
a duplicate of the patch to a different location on 'finish'
operation.

Alex
Robert Yang June 17, 2026, 4:38 p.m. UTC | #2
Hi Alex,

On 6/17/26 00:09, Alexander Kanavin wrote:
> On Tue, 16 Jun 2026 at 17:51, Robert Yang via lists.openembedded.org
> <liezhi.yang=windriver.com@lists.openembedded.org> wrote:
>> +# To help "devtool finish" can add 0001-Ignore-pwritev-pwrite64-tests-on-musl.patch
>> +# into strace/strace rather than strace/files.
>> +FILESPATH .= ":${FILE_DIRNAME}/${BPN}"
> 
> I'm afraid I have to disagree with this. Devtool does have support for
> conditional patches as seen here:
> 
> ====
> alex@Zen2:/srv/storage/alex/yocto/build-riscv64$ devtool modify strace
> ...
> INFO: SRC_URI contains some conditional appends/prepends - will create
> branches to represent these
> ...
> WARNING: SRC_URI is conditionally overridden in this recipe, thus
> several devtool-override-* branches have been created, one for each
> override that makes changes to SRC_URI. It is recommended that you
> make changes to the devtool branch first, then checkout and rebase
> each devtool-override-* branch and update any unique patches there
> (duplicates on those branches will be ignored by devtool
> finish/update-recipe)

The problem is that "devtool upgrade" doesn't copy the overridden patch
to workspace because it is not in SRC_URI, I'm trying to see how to make it copy
that.

// Robert

> ...
> 
> alex@Zen2:/srv/storage/alex/yocto/build-riscv64/workspace/sources/strace$
> git branch
> * devtool
>    devtool-no-overrides
>    devtool-override-libc-musl
>    master
> ====
> 
> so this strace issue is hitting a bug in that conditional patch
> support. Rather, it should be investigated why is devtool writing out
> a duplicate of the patch to a different location on 'finish'
> operation.
> 
> Alex
diff mbox series

Patch

diff --git a/meta/recipes-devtools/strace/strace_6.19.bb b/meta/recipes-devtools/strace/strace_6.19.bb
index 7b8d4851fb..b92bfc4f31 100644
--- a/meta/recipes-devtools/strace/strace_6.19.bb
+++ b/meta/recipes-devtools/strace/strace_6.19.bb
@@ -22,6 +22,10 @@  SRC_URI:append:libc-musl = "\
            "
 SRC_URI[sha256sum] = "e076c851eec0972486ec842164fdc54547f9d17abd3d1449de8b120f5d299143"
 
+# To help "devtool finish" can add 0001-Ignore-pwritev-pwrite64-tests-on-musl.patch
+# into strace/strace rather than strace/files.
+FILESPATH .= ":${FILE_DIRNAME}/${BPN}"
+
 # remove at next version upgrade or when output changes
 PR = "r1"
 HASHEQUIV_HASH_VERSION .= ".1"