public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] devtool-source: set S variable to a sub dir of UNPACKDIR
@ 2026-04-16  8:14 Benjamin Robin (Schneider Electric)
  2026-04-16 10:31 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Robin (Schneider Electric) @ 2026-04-16  8:14 UTC (permalink / raw)
  To: openembedded-core
  Cc: richard.purdie, ross.burton, antonin.godard,
	mathieu.dubois-briand, thomas.petazzoni,
	Benjamin Robin (Schneider Electric)

If a recipe set UNPACKDIR to a directory that is not contained within
WORKDIR, before this modification, this generates the following error:
"S should be set relative to UNPACKDIR."

S should not be updated, otherwise the recipe may not find the extracted
sources. In all recipes, S should reference the UNPACKDIR variable.
There is an exception for the kernel to prevent infinite recursion
when expanding the STAGING_KERNEL_DIR variable.

So, only updates UNPACKDIR to be within the DEVTOOL_TEMPDIR directory.

Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
---
I have done various testing, but since I don't know all the requirements
of devtool, and all the impacts of this change, I may have broken some
stuff (I hope not).

This patch fixes the following command:
 - devtool upgrade sbom-cve-check-update-cvelist-native

It does not break the following commands:
 - devtool upgrade linux-yocto
 - devtool upgrade python3-sbom-cve-check
---
 meta/classes/devtool-source.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes/devtool-source.bbclass b/meta/classes/devtool-source.bbclass
index 2e0070486b46..fcc053120343 100644
--- a/meta/classes/devtool-source.bbclass
+++ b/meta/classes/devtool-source.bbclass
@@ -37,12 +37,11 @@ python() {
     workdir = os.path.join(tempdir, 'workdir')
     d.setVar('WORKDIR', workdir)
     if not d.getVar('S').startswith(workdir):
+        d.setVar('UNPACKDIR', os.path.join(workdir, 'sources'))
         # Usually a shared workdir recipe (kernel, gcc)
         # Try to set a reasonable default
         if bb.data.inherits_class('kernel', d):
-            d.setVar('S', '${WORKDIR}/source')
-        else:
-            d.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S')))
+            d.setVar('S', '${UNPACKDIR}/source')
     if bb.data.inherits_class('kernel', d):
         # We don't want to move the source to STAGING_KERNEL_DIR here
         d.setVar('STAGING_KERNEL_DIR', '${S}')

---
base-commit: 8b5f530fc57ba0e04c47b2d7338f5c0f862b084f
change-id: 20260416-fix-devtool-source-a76f6eb22c11

Best regards,
--  
Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] devtool-source: set S variable to a sub dir of UNPACKDIR
  2026-04-16  8:14 [PATCH] devtool-source: set S variable to a sub dir of UNPACKDIR Benjamin Robin (Schneider Electric)
@ 2026-04-16 10:31 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2026-04-16 10:31 UTC (permalink / raw)
  To: Benjamin Robin (Schneider Electric), openembedded-core
  Cc: ross.burton, antonin.godard, mathieu.dubois-briand,
	thomas.petazzoni

On Thu, 2026-04-16 at 10:14 +0200, Benjamin Robin (Schneider Electric) wrote:
> If a recipe set UNPACKDIR to a directory that is not contained within
> WORKDIR, before this modification, this generates the following error:
> "S should be set relative to UNPACKDIR."
> 
> S should not be updated, otherwise the recipe may not find the extracted
> sources. In all recipes, S should reference the UNPACKDIR variable.
> There is an exception for the kernel to prevent infinite recursion
> when expanding the STAGING_KERNEL_DIR variable.
> 
> So, only updates UNPACKDIR to be within the DEVTOOL_TEMPDIR directory.
> 
> Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
> ---
> I have done various testing, but since I don't know all the requirements
> of devtool, and all the impacts of this change, I may have broken some
> stuff (I hope not).
> 
> This patch fixes the following command:
>  - devtool upgrade sbom-cve-check-update-cvelist-native
> 
> It does not break the following commands:
>  - devtool upgrade linux-yocto
>  - devtool upgrade python3-sbom-cve-check

For reference devtool has a strong test suite and you can run it with
"oe-selftest -r devtool".

Cheers,

Richard


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-16 10:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16  8:14 [PATCH] devtool-source: set S variable to a sub dir of UNPACKDIR Benjamin Robin (Schneider Electric)
2026-04-16 10:31 ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox