diff mbox series

[RFC,9/9] base.bbclass: drop compatibility moving of sources into workdir

Message ID 20250610094400.1653931-9-alex.kanavin@gmail.com
State New
Headers show
Series [RFC,1/9] bitbake.conf: set BB_GIT_DEFAULT_DESTSUFFIX to match default S value | expand

Commit Message

Alexander Kanavin June 10, 2025, 9:44 a.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Potentially there could be a grace period for fixing recipes (with warnings, etc),
on the other hand, changes to git unpacking destination would already
break various layers, so we might as well make this a hard qa error and drop
the magic at the same time.

I commit to sending fixes for layers included in autobuilder testing
(meta-oe/arm/intel/virt/agl/aws/mingw/etc).

SOURCE_BASEDIR is at the same time adjusted to be calculated relative
to UNPACKDIR (previously it only worked if S was set to
WORKDIR/something/otherthing, and that is no longer working). It is also
no longer removed from the filesystem, as content of unpackdir is managed elsewhere.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes-global/base.bbclass | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index 8215969c7bb..0f4efa272cb 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -168,23 +168,16 @@  python base_do_unpack() {
 
     basedir = None
     unpackdir = d.getVar('UNPACKDIR')
-    workdir = d.getVar('WORKDIR')
-    if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir):
-        basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0]
+    if sourcedir.startswith(unpackdir):
+        basedir = sourcedir.replace(unpackdir, '').strip("/").split('/')[0]
         if basedir:
-            bb.utils.remove(workdir + '/' + basedir, True)
-            d.setVar("SOURCE_BASEDIR", workdir + '/' + basedir)
+            d.setVar("SOURCE_BASEDIR", unpackdir + '/' + basedir)
 
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.unpack(d.getVar('UNPACKDIR'))
     except bb.fetch2.BBFetchException as e:
         bb.fatal("Bitbake Fetcher Error: " + repr(e))
-
-    if basedir and os.path.exists(unpackdir + '/' + basedir):
-        # Compatibility magic to ensure ${WORKDIR}/git and ${WORKDIR}/${BP}
-        # as often used in S work as expected.
-        shutil.move(unpackdir + '/' + basedir, workdir + '/' + basedir)
 }
 
 SSTATETASKS += "do_deploy_source_date_epoch"