diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
| commit | 8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch) | |
| tree | efdc32587159d0050a69009bdf2330a531727d95 /scripts/lib/devtool/build.py | |
| parent | d412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff) | |
| download | poky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz | |
The poky repository master branch is no longer being updated.
You can either:
a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs
b) use the new bitbake-setup
You can find information about either approach in our documentation:
https://docs.yoctoproject.org/
Note that "poky" the distro setting is still available in meta-yocto as
before and we continue to use and maintain that.
Long live Poky!
Some further information on the background of this change can be found
in: https://lists.openembedded.org/g/openembedded-architecture/message/2179
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/build.py')
| -rw-r--r-- | scripts/lib/devtool/build.py | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/scripts/lib/devtool/build.py b/scripts/lib/devtool/build.py deleted file mode 100644 index 0b2c3d33dc..0000000000 --- a/scripts/lib/devtool/build.py +++ /dev/null | |||
| @@ -1,92 +0,0 @@ | |||
| 1 | # Development tool - build command plugin | ||
| 2 | # | ||
| 3 | # Copyright (C) 2014-2015 Intel Corporation | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | # | ||
| 7 | """Devtool build plugin""" | ||
| 8 | |||
| 9 | import os | ||
| 10 | import bb | ||
| 11 | import logging | ||
| 12 | import argparse | ||
| 13 | import tempfile | ||
| 14 | from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError | ||
| 15 | from devtool import parse_recipe | ||
| 16 | |||
| 17 | logger = logging.getLogger('devtool') | ||
| 18 | |||
| 19 | |||
| 20 | def _set_file_values(fn, values): | ||
| 21 | remaining = list(values.keys()) | ||
| 22 | |||
| 23 | def varfunc(varname, origvalue, op, newlines): | ||
| 24 | newvalue = values.get(varname, origvalue) | ||
| 25 | remaining.remove(varname) | ||
| 26 | return (newvalue, '=', 0, True) | ||
| 27 | |||
| 28 | with open(fn, 'r') as f: | ||
| 29 | (updated, newlines) = bb.utils.edit_metadata(f, values, varfunc) | ||
| 30 | |||
| 31 | for item in remaining: | ||
| 32 | updated = True | ||
| 33 | newlines.append('%s = "%s"' % (item, values[item])) | ||
| 34 | |||
| 35 | if updated: | ||
| 36 | with open(fn, 'w') as f: | ||
| 37 | f.writelines(newlines) | ||
| 38 | return updated | ||
| 39 | |||
| 40 | def _get_build_tasks(config): | ||
| 41 | tasks = config.get('Build', 'build_task', 'populate_sysroot,packagedata').split(',') | ||
| 42 | return ['do_%s' % task.strip() for task in tasks] | ||
| 43 | |||
| 44 | def build(args, config, basepath, workspace): | ||
| 45 | """Entry point for the devtool 'build' subcommand""" | ||
| 46 | workspacepn = check_workspace_recipe(workspace, args.recipename, bbclassextend=True) | ||
| 47 | tinfoil = setup_tinfoil(config_only=False, basepath=basepath) | ||
| 48 | try: | ||
| 49 | rd = parse_recipe(config, tinfoil, args.recipename, appends=True, filter_workspace=False) | ||
| 50 | if not rd: | ||
| 51 | return 1 | ||
| 52 | deploytask = 'do_deploy' in bb.build.listtasks(rd) | ||
| 53 | finally: | ||
| 54 | tinfoil.shutdown() | ||
| 55 | |||
| 56 | if args.clean: | ||
| 57 | # use clean instead of cleansstate to avoid messing things up in eSDK | ||
| 58 | build_tasks = ['do_clean'] | ||
| 59 | else: | ||
| 60 | build_tasks = _get_build_tasks(config) | ||
| 61 | if deploytask: | ||
| 62 | build_tasks.append('do_deploy') | ||
| 63 | |||
| 64 | bbappend = workspace[workspacepn]['bbappend'] | ||
| 65 | if args.disable_parallel_make: | ||
| 66 | logger.info("Disabling 'make' parallelism") | ||
| 67 | _set_file_values(bbappend, {'PARALLEL_MAKE': ''}) | ||
| 68 | try: | ||
| 69 | bbargs = [] | ||
| 70 | for task in build_tasks: | ||
| 71 | if args.recipename.endswith('-native') and 'package' in task: | ||
| 72 | continue | ||
| 73 | bbargs.append('%s:%s' % (args.recipename, task)) | ||
| 74 | exec_build_env_command(config.init_path, basepath, 'bitbake %s' % ' '.join(bbargs), watch=True) | ||
| 75 | except bb.process.ExecutionError as e: | ||
| 76 | # We've already seen the output since watch=True, so just ensure we return something to the user | ||
| 77 | return e.exitcode | ||
| 78 | finally: | ||
| 79 | if args.disable_parallel_make: | ||
| 80 | _set_file_values(bbappend, {'PARALLEL_MAKE': None}) | ||
| 81 | |||
| 82 | return 0 | ||
| 83 | |||
| 84 | def register_commands(subparsers, context): | ||
| 85 | """Register devtool subcommands from this plugin""" | ||
| 86 | parser_build = subparsers.add_parser('build', help='Build a recipe', | ||
| 87 | description='Builds the specified recipe using bitbake (up to and including %s)' % ', '.join(_get_build_tasks(context.config)), | ||
| 88 | group='working', order=50) | ||
| 89 | parser_build.add_argument('recipename', help='Recipe to build') | ||
| 90 | parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism') | ||
| 91 | parser_build.add_argument('-c', '--clean', action='store_true', help='clean up recipe building results') | ||
| 92 | parser_build.set_defaults(func=build) | ||
