eSDK fixes
cover eSDK fixes
Task dependency fixes for the extensible SDK.
NOTE: two of these patches depend upon the patch I just sent to bitbake-devel adding bb.build.tasksbetween().
The following changes since commit b3a74335e1f9701ce2d6217080800baf3a61acb4:
Revert "yocto-bsps: add 4.9 bbappend" (2017-02-06 14:45:48 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/esdk-fixes4
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/esdk-fixes4
Paul Eggleton (3):
classes/populate_sdk_ext: remove unnecessary dependencies breaking SDK_TARGETS classes/patch: switch to new bb.build.tasksbetween() function classes/populate_sdk_ext: account for custom image tasks
meta/classes/patch.bbclass | 20 +------------------- meta/classes/populate_sdk_ext.bbclass | 10 ++++++---- 2 files changed, 7 insertions(+), 23 deletions(-)
Signature · 1 line
2.9.3
PATCH 1/3 classes/populate_sdk_ext: remove unnecessary dependencies breaking SDK_TARGETS
Up until recently it was possible to set SDK_TARGETS to include a native recipe you wanted installed into the sysroot when installing the eSDK. I'm not sure what happened but now when you try to add a native recipe to SDK_TARGETS you get a missing task error because this recipe has no do_package_write_* task. Of course such a task dependency is erroneous and is apparently caused by setting SDK_RDEPENDS. I've checked and it turns out that we no longer need to set SDK_RDEPENDS anyway (probably because we explicitly set up task dependencies further down in the class, which I don't think we were fully doing in early versions of the eSDK). Thus, drop setting this variable to restore the functionality.
--- meta/classes/populate_sdk_ext.bbclass | 2 -- 1 file changed, 2 deletions(-)
meta/classes/populate_sdk_ext.bbclass +0 -2
@@ -11,8 +11,6 @@ TOOLCHAIN_HOST_TASK_task-populate-sdk-ext = " \ TOOLCHAIN_TARGET_TASK_task-populate-sdk-ext = "" -SDK_RDEPENDS_append_task-populate-sdk-ext = " ${SDK_TARGETS}" - SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0" SDK_EXT = ""
Signature · 1 line
2.9.3
PATCH 2/3 classes/patch: switch to new bb.build.tasksbetween() function
In reply to Paul EggletonA generic version of the code to work out the tasks between two tasks (based on the code here) has been added to bb.build, so use that instead.
--- meta/classes/patch.bbclass | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
meta/classes/patch.bbclass +1 -19
@@ -12,25 +12,7 @@ inherit terminal python () { if d.getVar('PATCHTOOL') == 'git' and d.getVar('PATCH_COMMIT_FUNCTIONS') == '1': - tasks = list(filter(lambda k: d.getVarFlag(k, "task"), d.keys())) - extratasks = [] - def follow_chain(task, endtask, chain=None): - if not chain: - chain = [] - chain.append(task) - for othertask in tasks: - if othertask == task: - continue - if task == endtask: - for ctask in chain: - if ctask not in extratasks: - extratasks.append(ctask) - else: - deps = d.getVarFlag(othertask, 'deps', False) - if task in deps: - follow_chain(othertask, endtask, chain) - chain.pop() - follow_chain('do_unpack', 'do_patch') + extratasks = bb.build.tasksbetween('do_unpack', 'do_patch', d) try: extratasks.remove('do_unpack') except ValueError:
Signature · 1 line
2.9.3
PATCH 3/3 classes/populate_sdk_ext: account for custom image tasks
In reply to Paul EggletonAny custom tasks that were added on the image between do_image_complete and do_build were not being taken into account. Use the newly added bb.build.tasksbetween() function to take care of that.
--- meta/classes/populate_sdk_ext.bbclass | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
meta/classes/populate_sdk_ext.bbclass +6 -2
@@ -45,8 +45,10 @@ def get_sdk_install_targets(d, images_only=False): sdk_install_targets = d.getVar('SDK_TARGETS') depd = d.getVar('BB_TASKDEPDATA', False) + tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d) + tasklist.remove('do_build') for v in depd.values(): - if v[1] == 'do_image_complete': + if v[1] in tasklist: if v[0] not in sdk_install_targets: sdk_install_targets += ' {}'.format(v[0])
@@ -630,7 +632,9 @@ def get_ext_sdk_depends(d): deps = d.getVarFlag('do_image_complete', 'deps', False) pn = d.getVar('PN') deplist = ['%s:%s' % (pn, dep) for dep in deps] - for task in ['do_image_complete', 'do_rootfs', 'do_build']: + tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d) + tasklist.append('do_rootfs') + for task in tasklist: deplist.extend((d.getVarFlag(task, 'depends') or '').split()) return ' '.join(deplist)
Signature · 1 line
2.9.3