Skip to contentSkip to conversation

extsdk bug fixes and minimal type addition

PATCH New Randy Witt 1 participant 6 messages Feb 4, 2016

lore
Share & tools
lore

Randy Witt

author
#0 lore raw

cover extsdk bug fixes and minimal type addition

The following changes since commit b33e440cc6fbd703e8045d94b806790343e72eb6:

libical: Work around hardcoded paths in pkgconfig file (2016-02-04 13:09:56 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib fcef7183f0ac9ab38715bb0c0a80109696d79b2d
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=fcef7183f0ac9ab38715bb0c0a80109696d79b2d

Randy Witt (5):
copy_buildsystem.py: Pass the nativelsb argument to
gen-lockedsig-cache
toolchain-scripts.bbclass: Use PYTHONPATH instead of PYTHONHOME
populate_sdk_ext: Don't set sdk_update_targets in the config
populate_sdk_ext: Add support for a "minimal" type
populate_sdk_ext: Make populate_sdk_ext depend on sdk_extra_conf

 meta/classes/populate_sdk_ext.bbclass  | 21 +++++++++++----------
 meta/classes/toolchain-scripts.bbclass |  2 +-
 meta/lib/oe/copy_buildsystem.py        |  9 ++++++++-
 3 files changed, 20 insertions(+), 12 deletions(-)
Signature · 1 line
2.5.0
author
#1 lore raw

PATCH 1/5 copy_buildsystem.py: Pass the nativelsb argument to gen-lockedsig-cache

If the nativelsb argument is not used, then create_locked_sstate_cache() can get collisions when moving the files from the input_sstate_cache to the output_sstate_cache.

The specific case where this was encountered was when a "universal" nativelsb directory already existed in the input_sstate_cache.

---
 meta/lib/oe/copy_buildsystem.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/lib/oe/copy_buildsystem.py +8 -1
index fb51b51..0627461 100644
@@ -154,4 +154,11 @@ def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cac
     if fixedlsbstring:
         nativedir = output_sstate_cache + '/' + nativelsbstring
         if os.path.isdir(nativedir):
-            os.rename(nativedir, output_sstate_cache + '/' + fixedlsbstring)
+            destdir = os.path.join(output_sstate_cache, fixedlsbstring)
+            bb.utils.mkdirhier(destdir)
+
+            dirlist = os.listdir(nativedir)
+            for i in dirlist:
+                src = os.path.join(nativedir, i)
+                dest = os.path.join(destdir, i)
+                os.rename(src, dest)
Signature · 1 line
2.5.0
author
#2 lore raw

PATCH 2/5 toolchain-scripts.bbclass: Use PYTHONPATH instead of PYTHONHOME

In reply to Randy Witt

In the extensible sdk it was originally intended that the native sstate would always be setscened as part of the sdk installation. However, the soon to come "minimal" sdk won't do that.

A side effect of that is that pointing PYTHONHOME at the native sysroot within the "bitbake workspace" won't work. For now only set PYTHONPATH instead and continue using the python that comes from buildtools.

---
 meta/classes/toolchain-scripts.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/toolchain-scripts.bbclass +1 -1
index ab4feb0..13e7390 100644
@@ -31,7 +31,7 @@ toolchain_create_sdk_env_script () {
 	echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
 	echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
 	echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
-	echo "export PYTHONHOME=$sdkpathnative$prefix" >> $script
+	echo "export PYTHONPATH=$sdkpathnative$prefix" >> $script
 	echo 'unset command_not_found_handle' >> $script
 
 	toolchain_shared_env_script
Signature · 1 line
2.5.0
author
#3 lore raw

PATCH 3/5 populate_sdk_ext: Don't set sdk_update_targets in the config

In reply to Randy Witt

sdk_update_targets isn't used by any code, so there is no reason to set it.

---
 meta/classes/populate_sdk_ext.bbclass | 1 -
 1 file changed, 1 deletion(-)
meta/classes/populate_sdk_ext.bbclass +0 -1
index da7fdfb..ba30023 100644
@@ -99,7 +99,6 @@ python copy_buildsystem () {
     config.set('General', 'core_meta_subdir', core_meta_subdir)
     config.add_section('SDK')
     config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS', True))
-    config.set('SDK', 'sdk_update_targets', d.getVar('SDK_INSTALL_TARGETS', True))
     updateurl = d.getVar('SDK_UPDATE_URL', True)
     if updateurl:
         config.set('SDK', 'updateserver', updateurl)
Signature · 1 line
2.5.0
author
#4 lore raw

PATCH 4/5 populate_sdk_ext: Add support for a "minimal" type

In reply to Randy Witt

If the user sets the SDK_EXT_TYPE variable to "minimal" then the sdk won't contain any sstate. The sstate can come from an sstate mirror and be installed on demand as usual.

---
 meta/classes/populate_sdk_ext.bbclass | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
meta/classes/populate_sdk_ext.bbclass +8 -7
index ba30023..caf8b6e 100644
@@ -18,6 +18,9 @@ SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0"
 SDK_EXT = ""
 SDK_EXT_task-populate-sdk-ext = "-ext"
 
+# Options are full or minimal
+SDK_EXT_TYPE ?= "full"
+
 SDK_LOCAL_CONF_WHITELIST ?= ""
 SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION \
                              BB_NUMBER_THREADS \
@@ -29,7 +32,7 @@ SDK_INHERIT_BLACKLIST ?= "buildhistory icecc"
 SDK_UPDATE_URL ?= ""
 
 SDK_TARGETS ?= "${PN}"
-SDK_INSTALL_TARGETS = "${SDK_TARGETS} ${@'meta-world-pkgdata:do_allpackagedata' if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1' else ''}"
+SDK_INSTALL_TARGETS = "${@SDK_TARGETS if d.getVar('SDK_EXT_TYPE', True) != 'minimal' else ''} ${@'meta-world-pkgdata:do_allpackagedata' if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1' else ''}"
 OE_INIT_ENV_SCRIPT ?= "oe-init-build-env"
 
 # The files from COREBASE that you want preserved in the COREBASE copied
@@ -203,10 +206,6 @@ python copy_buildsystem () {
     bb.utils.remove(sstate_out, True)
     # uninative.bbclass sets NATIVELSBSTRING to 'universal'
     fixedlsbstring = 'universal'
-    oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
-                                                   d.getVar('SSTATE_DIR', True),
-                                                   sstate_out, d,
-                                                   fixedlsbstring)
 
     # Add packagedata if enabled
     if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
@@ -218,7 +217,9 @@ python copy_buildsystem () {
                                              d.getVar('STAGING_DIR_HOST', True) + '/world-pkgdata/locked-sigs-pkgdata.inc',
                                              lockedsigs_pruned,
                                              lockedsigs_copy)
-        oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_copy,
+
+    if d.getVar('SDK_EXT_TYPE', True) != 'minimal':
+        oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
                                                        d.getVar('SSTATE_DIR', True),
                                                        sstate_out, d,
                                                        fixedlsbstring)
@@ -302,7 +303,7 @@ sdk_ext_postinst() {
 	# For now this is where uninative.bbclass expects the tarball
 	mv *-nativesdk-libc.tar.* $target_sdk_dir/`dirname ${oe_init_build_env_path}`
 
-	if [ "$prepare_buildsystem" != "no" ]; then
+	if [ "$prepare_buildsystem" != "no" -a -n "${@SDK_INSTALL_TARGETS.strip()}" ]; then
 		printf "Preparing build system...\n"
 		# dash which is /bin/sh on Ubuntu will not preserve the
 		# current working directory when first ran, nor will it set $1 when
Signature · 1 line
2.5.0
author
#5 lore raw

PATCH 5/5 populate_sdk_ext: Make populate_sdk_ext depend on sdk_extra_conf

In reply to Randy Witt

If a user changes sdk_extra_conf, it should cause populate_sdk_ext to run.

---
 meta/classes/populate_sdk_ext.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/populate_sdk_ext.bbclass +3 -2
index caf8b6e..704c003 100644
@@ -361,8 +361,9 @@ do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', Fa
 
 do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':do_build' for x in d.getVar('SDK_TARGETS', True).split()])}"
 
-# Make sure codes change in copy_buildsystem can result in rebuilt
-do_populate_sdk_ext[vardeps] += "copy_buildsystem"
+# Make sure code changes can result in rebuild
+do_populate_sdk_ext[vardeps] += "copy_buildsystem \
+                                 sdk_ext_postinst"
 
 do_populate_sdk_ext[file-checksums] += "${COREBASE}/meta/files/toolchain-shar-relocate.sh:True \
                                         ${COREBASE}/meta/files/toolchain-shar-extract.sh:True \
Signature · 1 line
2.5.0