Skip to contentSkip to conversation

Path-related fixes for the extensible SDK

PATCH New Paul Eggleton 1 participant 3 messages Sep 14, 2016

lore
Share & tools
lore
#0 lore raw

cover Path-related fixes for the extensible SDK

The following changes since commit 4d268abc2fc892c5d34449f78c8e9f2b1a9d6bac:

oeqa.runtime.smart: work around smart race issues (2016-09-09 12:12:17 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/extsdk-path-fixes
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/extsdk-path-fixes

Paul Eggleton (2):
classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path lib/oe/copy_buildsystem: fix building eSDK with indirect paths in BBLAYERS

 meta/classes/populate_sdk_ext.bbclass | 7 ++++---
 meta/lib/oe/copy_buildsystem.py       | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/2 classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path

After we run the build system within the eSDK internally as part of the sstate filtering that happens during do_populate_sdk_ext, we need to ensure that the TMPDIR created during that process gets deleted. However we were using the TMPDIR path for the build producing the eSDK which may not be the same (since that value would typically be filtered out) thus if the user had set TMPDIR to something other than the default, the temporary TMPDIR would not be deleted which not only led to extraneous junk entering the SDK but also failures during install because the TMPDIR path was different. In order to fix this, force TMPDIR to a known value during the sstate filtering run so we know what to delete afterwards.

Fixes [YOCTO #10210].

---
 meta/classes/populate_sdk_ext.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/classes/populate_sdk_ext.bbclass +4 -3
index d8d123a..b64bf0b 100644
@@ -88,8 +88,7 @@ SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar(
 def clean_esdk_builddir(d, sdkbasepath):
     """Clean up traces of the fake build for create_filtered_tasklist()"""
     import shutil
-    cleanpaths = 'cache conf/sanity_info conf/templateconf.cfg'.split()
-    cleanpaths.append(os.path.basename(d.getVar('TMPDIR', True)))
+    cleanpaths = 'cache conf/sanity_info conf/templateconf.cfg tmp'.split()
     for pth in cleanpaths:
         fullpth = os.path.join(sdkbasepath, pth)
         if os.path.isdir(fullpth):
@@ -109,10 +108,12 @@ def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath):
     # Create a temporary build directory that we can pass to the env setup script
     shutil.copyfile(sdkbasepath + '/conf/local.conf', sdkbasepath + '/conf/local.conf.bak')
     try:
-        # Force the use of sstate from the build system
         with open(sdkbasepath + '/conf/local.conf', 'a') as f:
+            # Force the use of sstate from the build system
             f.write('\nSSTATE_DIR_forcevariable = "%s"\n' % d.getVar('SSTATE_DIR', True))
             f.write('SSTATE_MIRRORS_forcevariable = ""\n')
+            # Ensure TMPDIR is the default so that clean_esdk_builddir() can delete it
+            f.write('TMPDIR_forcevariable = "${TOPDIR}/tmp"\n')
             # Drop uninative if the build isn't using it (or else NATIVELSBSTRING will
             # be different and we won't be able to find our native sstate)
             if not bb.data.inherits_class('uninative', d):
Signature · 1 line
2.5.5
#2 lore raw

PATCH 2/2 lib/oe/copy_buildsystem: fix building eSDK with indirect paths in BBLAYERS

In reply to Paul Eggleton

Indirect paths (e.g. ${TOPDIR}/../meta-something) do generally work if used in BBLAYERS in bblayers.conf. However, if you built an extensible SDK with this configuration then the creation of the workspace within the SDK using devtool in do_populate_sdk_ext failed. This is because the copy_buildsystem code was no longer correctly recognising that the core layer ("meta") was part of a repository (e.g. openembedded-core / poky) that should be shipped together - because of the indirection - and thus it was splitting out the meta directory, and a number of places in the code assume that the meta directory is next to the scripts directory. Use os.path.abspath() to flatten out any indirections.

---
 meta/lib/oe/copy_buildsystem.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oe/copy_buildsystem.py +2 -2
index 3d5a746..afaff68 100644
@@ -17,7 +17,7 @@ class BuildSystem(object):
     def __init__(self, context, d):
         self.d = d
         self.context = context
-        self.layerdirs = d.getVar('BBLAYERS', True).split()
+        self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS', True).split()]
         self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE', True) or "").split()
 
     def copy_bitbake_and_layers(self, destdir, workspace_name=None):
@@ -26,7 +26,7 @@ class BuildSystem(object):
         bb.utils.mkdirhier(destdir)
         layers = list(self.layerdirs)
 
-        corebase = self.d.getVar('COREBASE', True)
+        corebase = os.path.abspath(self.d.getVar('COREBASE', True))
         layers.append(corebase)
 
         # Exclude layers
Signature · 1 line
2.5.5