* [PATCH 1/2] archiver: check tasks exist before adding dependencies
@ 2018-09-28 13:45 Ross Burton
2018-09-28 13:45 ` [PATCH 2/2] archiver: generalise task running when in configured mode Ross Burton
0 siblings, 1 reply; 2+ messages in thread
From: Ross Burton @ 2018-09-28 13:45 UTC (permalink / raw)
To: openembedded-core
Some recipes don't have do_configure, or have them but are marked as noexec.
Check for their existance before hooking up dependencies.
[ YOCTO #12868 ]
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/archiver.bbclass | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 31c9b7eb4b6..7c3e701e704 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -98,9 +98,12 @@ python () {
# There is a corner case with "gcc-source-${PV}" recipes, they don't have
# the "do_configure" task, so we need to use "do_preconfigure"
- if pn.startswith("gcc-source-"):
+ def hasTask(task):
+ return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
+
+ if hasTask("do_preconfigure"):
d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn)
- else:
+ elif hasTask("do_configure"):
d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_configure' % pn)
d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_configured' % pn)
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] archiver: generalise task running when in configured mode
2018-09-28 13:45 [PATCH 1/2] archiver: check tasks exist before adding dependencies Ross Burton
@ 2018-09-28 13:45 ` Ross Burton
0 siblings, 0 replies; 2+ messages in thread
From: Ross Burton @ 2018-09-28 13:45 UTC (permalink / raw)
To: openembedded-core
When in configured mode the archive will re-run configure itself, but that
doesn't work if there are other tasks that need to run such as cmake's
generate_toolchain_file.
Instead of hard-coding a list of classes and tasks, obtain the list of tasks
preceeding do_configure, filter out ones we don't want to re-run such as
do_patch and do_prepare_recipe_sysroot, and run those too.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/archiver.bbclass | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 7c3e701e704..a54cf948f3e 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -246,21 +246,27 @@ python do_ar_configured() {
# do_configure, we archive the already configured ${S} to
# instead of.
elif pn != 'libtool-native':
+ def runTask(task):
+ bb.warn("running %s" % task)
+ prefuncs = d.getVarFlag(task, 'prefuncs') or ''
+ for func in prefuncs.split():
+ if func != "sysroot_cleansstate":
+ bb.build.exec_func(func, d)
+ bb.build.exec_func(task, d)
+ postfuncs = d.getVarFlag(task, 'postfuncs') or ''
+ for func in postfuncs.split():
+ if func != 'do_qa_configure':
+ bb.build.exec_func(func, d)
+
# Change the WORKDIR to make do_configure run in another dir.
d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
- if bb.data.inherits_class('kernel-yocto', d):
- bb.build.exec_func('do_kernel_configme', d)
- if bb.data.inherits_class('cmake', d):
- bb.build.exec_func('do_generate_toolchain_file', d)
- prefuncs = d.getVarFlag('do_configure', 'prefuncs')
- for func in (prefuncs or '').split():
- if func != "sysroot_cleansstate":
- bb.build.exec_func(func, d)
- bb.build.exec_func('do_configure', d)
- postfuncs = d.getVarFlag('do_configure', 'postfuncs')
- for func in (postfuncs or '').split():
- if func != "do_qa_configure":
- bb.build.exec_func(func, d)
+
+ preceeds = bb.build.preceedtask('do_configure', False, d)
+ for task in preceeds:
+ if task != 'do_patch' and task != 'do_prepare_recipe_sysroot':
+ runTask(task)
+ runTask('do_configure')
+
srcdir = d.getVar('S')
builddir = d.getVar('B')
if srcdir != builddir:
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-28 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-28 13:45 [PATCH 1/2] archiver: check tasks exist before adding dependencies Ross Burton
2018-09-28 13:45 ` [PATCH 2/2] archiver: generalise task running when in configured mode Ross Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox