Skip to contentSkip to conversation

eSDK fixes

PATCH New Paul Eggleton 1 participant 3 messages Jan 19, 2017

lore
Share & tools
lore
#0 lore raw

cover eSDK fixes

The following changes since commit a7cb408dd784178197687a2129e936620bf6a0d3:

sanity.bbclass: Improved error message (2017-01-17 11:31:31 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/esdk-fixes3
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/esdk-fixes3

Paul Eggleton (2):
classes/populate_sdk_ext: force a known value for TMPDIR Revert "classes/sstate: add a mode to error if sstate package unavailable"

 meta/classes/populate_sdk_ext.bbclass             |  5 +++--
 meta/classes/sstate.bbclass                       | 23 -----------------------
 meta/recipes-core/meta/meta-environment-extsdk.bb |  4 ++--
 3 files changed, 5 insertions(+), 27 deletions(-)
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/2 classes/populate_sdk_ext: force a known value for TMPDIR

If TMPDIR is configured to be somewhere outside of TOPDIR (a not uncommon configuration where you have multiple disks and space on /home is at a premium) then our attempt to find out the location of paths under TMPDIR by using a relative path led to horribly broken paths ending up in the eSDK. To save pain, just force a known value for TMPDIR (i.e. ${TOPDIR}/tmp) and then we can assume that everywhere else.

Fixes [YOCTO #10797].

---
 meta/classes/populate_sdk_ext.bbclass             | 5 +++--
 meta/recipes-core/meta/meta-environment-extsdk.bb | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
meta/classes/populate_sdk_ext.bbclass +3 -2
index f21ae8b..d5f6de9 100644
@@ -282,6 +282,7 @@ python copy_buildsystem () {
             # Write a newline just in case there's none at the end of the original
             f.write('\n')
 
+            f.write('TMPDIR = "${TOPDIR}/tmp"\n')
             f.write('DL_DIR = "${TOPDIR}/downloads"\n')
 
             f.write('INHERIT += "%s"\n' % 'uninative')
@@ -512,8 +513,8 @@ install_tools() {
 	# (they get populated from sstate on installation)
 	unfsd_path="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd"
 	if [ "${SDK_INCLUDE_TOOLCHAIN}" == "1" -a ! -e $unfsd_path ] ; then
-		binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TOPDIR'))}
-		lnr ${SDK_OUTPUT}/${SDKPATH}/$binrelpath/unfsd $unfsd_path
+		binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TMPDIR'))}
+		lnr ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
 	fi
 	touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
 
meta/recipes-core/meta/meta-environment-extsdk.bb +2 -2
index 76d2661..757afc1 100644
@@ -5,8 +5,8 @@ require meta-environment.bb
 PN = "meta-environment-extsdk-${MACHINE}"
 
 create_sdk_files_append() {
-	local sysroot=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET'), d.getVar('TOPDIR'))}
-	local sdkpathnative=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE'), d.getVar('TOPDIR'))}
+	local sysroot=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET'), d.getVar('TMPDIR'))}
+	local sdkpathnative=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE'), d.getVar('TMPDIR'))}
 
 	toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
 }
Signature · 1 line
2.5.5
#2 lore raw

PATCH 2/2 Revert "classes/sstate: add a mode to error if sstate package unavailable"

In reply to Paul Eggleton

It turns out that this check cannot work. We don't have the information to know whether an sstate package is really needed at this point in the execution, so we check the availability for things that we won't actually end up needing later on. Thus we can't fail if some of these aren't found or we'll get needless failures.

This check was intended to give earlier more accurate errors when sstate artifacts failed to download, but that's not practical so we'll rely solely on the task execution check that was added within the runqueue.

This reverts most of commit 9e711b54487c3141d7264b8cf0d74f9465020190 (we still need to allow BB_SETSCENE_ENFORCE through from the external environment since the eSDK relies upon that.)

---
 meta/classes/sstate.bbclass | 23 -----------------------
 1 file changed, 23 deletions(-)
meta/classes/sstate.bbclass +0 -23
index afdb4a3..dff530f 100644
@@ -738,7 +738,6 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
 
     ret = []
     missed = []
-    missing = []
     extension = ".tgz"
     if siginfo:
         extension = extension + ".siginfo"
@@ -760,18 +759,6 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
 
         return spec, extrapath, tname
 
-    def sstate_pkg_to_pn(pkg, d):
-        """
-        Translate an sstate filename to a PN value by way of SSTATE_PKGSPEC. This is slightly hacky but
-        we don't have access to everything in this context.
-        """
-        pkgspec = d.getVar('SSTATE_PKGSPEC', False)
-        try:
-            idx = pkgspec.split(':').index('${PN}')
-        except ValueError:
-            bb.fatal('Unable to find ${PN} in SSTATE_PKGSPEC')
-        return pkg.split(':')[idx]
-
 
     for task in range(len(sq_fn)):
 
@@ -806,8 +793,6 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
         if localdata.getVar('BB_NO_NETWORK') == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK') == "1":
             localdata.delVar('BB_NO_NETWORK')
 
-        whitelist = bb.runqueue.get_setscene_enforce_whitelist(d)
-
         from bb.fetch2 import FetchConnectionCache
         def checkstatus_init(thread_worker):
             thread_worker.connection_cache = FetchConnectionCache()
@@ -834,12 +819,6 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
             except:
                 missed.append(task)
                 bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
-                if whitelist:
-                    pn = sstate_pkg_to_pn(sstatefile, d)
-                    taskname = sq_task[task]
-                    if not bb.runqueue.check_setscene_enforce_whitelist(pn, taskname, whitelist):
-                        missing.append(task)
-                        bb.error('Sstate artifact unavailable for %s.%s' % (pn, taskname))
                 pass
             bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d)
 
@@ -867,8 +846,6 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
             bb.event.disable_threadlock()
 
             bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
-            if whitelist and missing:
-                bb.fatal('Required artifacts were unavailable - exiting')
 
     inheritlist = d.getVar("INHERIT")
     if "toaster" in inheritlist:
Signature · 1 line
2.5.5