summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/devtool.py7
-rw-r--r--scripts/lib/devtool/build.py16
2 files changed, 17 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 43c7cdade1..d95cb08749 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -226,8 +226,13 @@ class DevtoolTests(DevtoolBase):
226 # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then) 226 # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then)
227 bitbake('libftdi -c cleansstate') 227 bitbake('libftdi -c cleansstate')
228 # libftdi's python/CMakeLists.txt is a bit broken, so let's just disable it 228 # libftdi's python/CMakeLists.txt is a bit broken, so let's just disable it
229 # There's also the matter of it installing cmake files to a path we don't
230 # normally cover, which triggers the installed-vs-shipped QA test we have
231 # within do_package
229 recipefile = '%s/recipes/libftdi/libftdi_%s.bb' % (self.workspacedir, version) 232 recipefile = '%s/recipes/libftdi/libftdi_%s.bb' % (self.workspacedir, version)
230 result = runCmd('recipetool setvar %s EXTRA_OECMAKE -- "-DPYTHON_BINDINGS=OFF"' % recipefile) 233 result = runCmd('recipetool setvar %s EXTRA_OECMAKE -- \'-DPYTHON_BINDINGS=OFF -DLIBFTDI_CMAKE_CONFIG_DIR=${datadir}/cmake/Modules\'' % recipefile)
234 with open(recipefile, 'a') as f:
235 f.write('\nFILES_${PN}-dev += "${datadir}/cmake/Modules"\n')
231 # Test devtool build 236 # Test devtool build
232 result = runCmd('devtool build libftdi') 237 result = runCmd('devtool build libftdi')
233 staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi') 238 staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi')
diff --git a/scripts/lib/devtool/build.py b/scripts/lib/devtool/build.py
index c4c0c9f50f..b10a6a903b 100644
--- a/scripts/lib/devtool/build.py
+++ b/scripts/lib/devtool/build.py
@@ -46,21 +46,27 @@ def _set_file_values(fn, values):
46 f.writelines(newlines) 46 f.writelines(newlines)
47 return updated 47 return updated
48 48
49def _get_build_task(config): 49def _get_build_tasks(config):
50 return config.get('Build', 'build_task', 'populate_sysroot') 50 tasks = config.get('Build', 'build_task', 'populate_sysroot,packagedata').split(',')
51 return ['do_%s' % task.strip() for task in tasks]
51 52
52def build(args, config, basepath, workspace): 53def build(args, config, basepath, workspace):
53 """Entry point for the devtool 'build' subcommand""" 54 """Entry point for the devtool 'build' subcommand"""
54 workspacepn = check_workspace_recipe(workspace, args.recipename, bbclassextend=True) 55 workspacepn = check_workspace_recipe(workspace, args.recipename, bbclassextend=True)
55 56
56 build_task = _get_build_task(config) 57 build_tasks = _get_build_tasks(config)
57 58
58 bbappend = workspace[workspacepn]['bbappend'] 59 bbappend = workspace[workspacepn]['bbappend']
59 if args.disable_parallel_make: 60 if args.disable_parallel_make:
60 logger.info("Disabling 'make' parallelism") 61 logger.info("Disabling 'make' parallelism")
61 _set_file_values(bbappend, {'PARALLEL_MAKE': ''}) 62 _set_file_values(bbappend, {'PARALLEL_MAKE': ''})
62 try: 63 try:
63 exec_build_env_command(config.init_path, basepath, 'bitbake -c %s %s' % (build_task, args.recipename), watch=True) 64 bbargs = []
65 for task in build_tasks:
66 if args.recipename.endswith('-native') and 'package' in task:
67 continue
68 bbargs.append('%s:%s' % (args.recipename, task))
69 exec_build_env_command(config.init_path, basepath, 'bitbake %s' % ' '.join(bbargs), watch=True)
64 except bb.process.ExecutionError as e: 70 except bb.process.ExecutionError as e:
65 # We've already seen the output since watch=True, so just ensure we return something to the user 71 # We've already seen the output since watch=True, so just ensure we return something to the user
66 return e.exitcode 72 return e.exitcode
@@ -73,7 +79,7 @@ def build(args, config, basepath, workspace):
73def register_commands(subparsers, context): 79def register_commands(subparsers, context):
74 """Register devtool subcommands from this plugin""" 80 """Register devtool subcommands from this plugin"""
75 parser_build = subparsers.add_parser('build', help='Build a recipe', 81 parser_build = subparsers.add_parser('build', help='Build a recipe',
76 description='Builds the specified recipe using bitbake (up to and including do_%s)' % _get_build_task(context.config)) 82 description='Builds the specified recipe using bitbake (up to and including %s)' % ', '.join(_get_build_tasks(context.config)))
77 parser_build.add_argument('recipename', help='Recipe to build') 83 parser_build.add_argument('recipename', help='Recipe to build')
78 parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism') 84 parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism')
79 parser_build.set_defaults(func=build) 85 parser_build.set_defaults(func=build)