All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Path-related fixes for the extensible SDK
@ 2016-09-14  5:09 Paul Eggleton
  2016-09-14  5:09 ` [PATCH 1/2] classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path Paul Eggleton
  2016-09-14  5:09 ` [PATCH 2/2] lib/oe/copy_buildsystem: fix building eSDK with indirect paths in BBLAYERS Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-09-14  5:09 UTC (permalink / raw)
  To: openembedded-core

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(-)

-- 
2.5.5



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

* [PATCH 1/2] classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path
  2016-09-14  5:09 [PATCH 0/2] Path-related fixes for the extensible SDK Paul Eggleton
@ 2016-09-14  5:09 ` Paul Eggleton
  2016-09-14  5:09 ` [PATCH 2/2] lib/oe/copy_buildsystem: fix building eSDK with indirect paths in BBLAYERS Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-09-14  5:09 UTC (permalink / raw)
  To: openembedded-core

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].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/populate_sdk_ext.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index d8d123a..b64bf0b 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -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):
-- 
2.5.5



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

* [PATCH 2/2] lib/oe/copy_buildsystem: fix building eSDK with indirect paths in BBLAYERS
  2016-09-14  5:09 [PATCH 0/2] Path-related fixes for the extensible SDK Paul Eggleton
  2016-09-14  5:09 ` [PATCH 1/2] classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path Paul Eggleton
@ 2016-09-14  5:09 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-09-14  5:09 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/copy_buildsystem.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 3d5a746..afaff68 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -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
-- 
2.5.5



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

end of thread, other threads:[~2016-09-14  5:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14  5:09 [PATCH 0/2] Path-related fixes for the extensible SDK Paul Eggleton
2016-09-14  5:09 ` [PATCH 1/2] classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path Paul Eggleton
2016-09-14  5:09 ` [PATCH 2/2] lib/oe/copy_buildsystem: fix building eSDK with indirect paths in BBLAYERS Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.