summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
3 daysrootfs.py: Fix logger error message formatJohn Ripple
--_000_PH7PR17MB61307CB6690EC00DEB4ED9B39C0F2PH7PR17MB6130namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This patch adds a missing "%s" format in a logger.error call. Without this addition the logger itself would error out and not print a useful message. Signed-off-by: John Ripple <john.ripple@keysight.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 daysdevtool: standard: update-recipe/finish: fix update localfile in another layerJulien Stephan
When trying to use devtool update-recipe/finish on another layer, with modified local file we have the following error: Traceback (most recent call last): File "<..>/poky/scripts/devtool", line 350, in <module> ret = main() ^^^^^^ File "<..>/poky/scripts/devtool", line 337, in main ret = args.func(args, config, basepath, workspace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<..>/poky/scripts/lib/devtool/standard.py", line 1968, in update_recipe updated, _, _ = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<..>/poky/scripts/lib/devtool/standard.py", line 1930, in _update_recipe updated, appendf, removed = _update_recipe_patch(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, initial_rev, dry_run_outdir, force_patch_refresh) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<..>/poky/scripts/lib/devtool/standard.py", line 1747, in _update_recipe_patch patchdir = param.get('patchdir', ".") ^^^^^^^^^ AttributeError: 'str' object has no attribute 'get' This was introduced when adding support for git submodules. No selftest case exists to catch this, so a selftest will be added in another commit. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
3 daysdevtool: sync: Fix Execution errorVincent Kriek
When executing devtool sync on a recipe that was extract with devtool extract earlier the following error occured: Traceback (most recent call last): [...] bb.process.ExecutionError: Execution of 'git fetch file:///home/vin/projects/poky/build/tmp/work/all-poky-linux/netbase/6.4/devtooltmp-figt1jmr/workdir/netbase devtool:devtool' failed with exit code 128: fatal: refusing to fetch into branch 'refs/heads/devtool' checked out at '/home/vin/projects/poky/build/netbase-src' Fix this by adding --update-head-ok and --force to git fetch so it will override the current head even if it is checked out and has changes. Possible existing changes in the devtool branch can be retrieved by checking out the devtool.bak branch Signed-off-by: Vincent Kriek <vincent@coelebs.dev> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
5 daysrecipetool: Handle several go-import tags in go resolverSven Schwermer
When dynamically resolving go modules, the HTML page may contain several go-import meta tags. We must handle all and pick the correct one based on the module name. An example for such a behaviour is gonum.org/v1/gonum: <meta name="go-import" content="gonum.org/v1/exp git https://github.com/gonum/exp"> <meta name="go-import" content="gonum.org/v1/gonum git https://github.com/gonum/gonum"> <meta name="go-import" content="gonum.org/v1/hdf5 git https://github.com/gonum/hdf5"> <meta name="go-import" content="gonum.org/v1/netlib git https://github.com/gonum/netlib"> <meta name="go-import" content="gonum.org/v1/plot git https://github.com/gonum/plot"> <meta name="go-import" content="gonum.org/v1/tools git https://github.com/gonum/tools"> Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
5 daysrecipetool: Handle unclean response in go resolverSven Schwermer
It appears that some go modules repond with a 404 error when trying to resolve them dynamically. The response body may still contain the go-import meta tag. An example for such behaviour is gonum.org/v1/gonum. Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-04-12devtool: standard: throws appropriate error if source is in detached HEADJulien Stephan
If source is in detached HEAD, we get the following error when using detvool finish command: [...] File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in _update_recipe bb.process.run('git checkout %s' % startbranch, cwd=srctree) File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run raise ExecutionError(cmd, pipe.returncode, stdout, stderr) bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 9bbf87e)' failed with exit code 2: /bin/sh: -c: line 1: syntax error near unexpected token `(' /bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)' Check this and throws an appropriate error in this case Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-26wic: bootimg-partition allow to set var to get boot filesAnibal Limon
This is a generic functionality that takes a set of files and create a boot parition based on IMAGE_BOOT_FILES var, allow to sepcify the variable name so a BSP plugin can extend this and re-use the functionality. Signed-off-by: Anibal Limon <anibal@limonsoftware.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-05bmaptool: now part of Yocto ProjectTrevor Woerner
The bmaptool (previously: bmap-tools, bmap-tool, bmaptool) has been moved to be under the Yocto Project umbrella and is now hosted at: github.com/yoctoproject/bmaptool [RP: Added a couple of missing renames] Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27devtool: ide-sdk prefer sources from workspaceAdrian Freihofer
Improve the previous commit: - log an error if some assumptions are not true - Use TARGET_DBGSRC_DIR variable - Do the same for ide none Why the additional source mapping is required: For example the cmake-example recipe refers to sources like this: ./recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-readelf \ -wi image/usr/bin/cmake-example | grep -B1 DW_AT_comp_dir ... <560> DW_AT_name : (indirect line string, offset: 0x1da): /usr/src/debug/cmake-example/1.0/oe-local-files/cpp-example.cpp ... Another example is powertop: ./recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-readelf \ -wi image/usr/sbin/powertop | grep -B1 DW_AT_comp_dir ... <561> DW_AT_name : (indirect line string, offset: 0x1da): /usr/src/debug/powertop/2.15/src/devlist.cpp ... For recipes with local files this works. The oe-local-files folder is not available in the rootfs-dbg and therefore the sources are first found in the workspace folder. GDB searches for source files in various places: https://sourceware.org/gdb/current/onlinedocs/gdb.html/Source-Path.html However, for the powertop example the sources opened in the editor are from the rootfs-dbg instead of from the workspace. Bitbake calls the compiler with -fmacro-prefix-map=${S}=${TARGET_DBGSRC_DIR} where TARGET_DBGSRC_DIR defaults to "/usr/src/debug/${PN}/${PV}". A source map which maps the recipe specific path from TARGET_DBGSRC_DIR to the workspace fixes this. The already existing source map for /usr/src/debug applies for all other recipes. It finds the sources (read only) in the rootfs-dbg folder. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27devtool: ide-sdk source mapping for vscodeEnguerrand de Ribaucourt
When launching the debug configuration, the source files from the debug rootfs were openened in the editor instead of the local workspace files. We add an exception to properly map them to the file being developed and compiled by the IDE integration. This also more closely matches what the user would expect compared to native development. This is also true for the devtool fallback mode. Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27devtool: ide-sdk launch.json per recipe onlyAdrian Freihofer
If multiple recipes are processed at once, the launch.json and the tasks.json of the second recipe contains also the configurations for the binaries of the first recipe. Example: devtool ide-sdk powertop cmake-example oe-selftest-image generated a launch and a tasks configuration for the cmake-example recipe which also offers debugging the powertop binary. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27wic: 'empty' plugin: fix typo in commentEnrico Jörns
Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24patchtest: provide further guidance for failed testcasesSimone Weiß
Cross-reference the wiki page on patchtest now that it is updated and contains more information how to address failed testcases. Adding it in patchtest only is enough as patchtest-send-result already points to the wikipage for failures. Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24devtool: ide-sdk python 3.12 escapingAdrian Freihofer
scripts/lib/devtool/ide_sdk.py:709: SyntaxWarning: invalid escape sequence '\.' re_so = re.compile('.*\.so[.0-9]*$') scripts/lib/devtool/ide_plugins/__init__.py:87: SyntaxWarning: invalid escape sequence '\$' gdbserver_cmd_start += "test -f \$TEMP_DIR/pid && exit 0; " scripts/lib/devtool/ide_plugins/__init__.py:88: SyntaxWarning: invalid escape sequence '\$' gdbserver_cmd_start += "mkdir -p \$TEMP_DIR; " scripts/lib/devtool/ide_plugins/__init__.py:89: SyntaxWarning: invalid escape sequence '\$' gdbserver_cmd_start += "%s --multi :%s > \$TEMP_DIR/log 2>&1 & " % ( scripts/lib/devtool/ide_plugins/__init__.py:91: SyntaxWarning: invalid escape sequence '\$' gdbserver_cmd_start += "echo \$! > \$TEMP_DIR/pid;" scripts/lib/devtool/ide_plugins/__init__.py:94: SyntaxWarning: invalid escape sequence '\$' gdbserver_cmd_stop += "test -f \$TEMP_DIR/pid && kill \$(cat \$TEMP_DIR/pid); " scripts/lib/devtool/ide_plugins/__init__.py:95: SyntaxWarning: invalid escape sequence '\$' gdbserver_cmd_stop += "rm -rf \$TEMP_DIR; " Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-23devtool: ide: define compilerPath for meson projectsEnguerrand de Ribaucourt
The compile_commands.json file output by meson uses the compiler as if present in the $PATH. However, when using an IDE, the $PATH used by bitbake is not there. The vscode-cpptools now allows to define the compilerPath in addition to replace the one from compile_commands.json. Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20devtool: ide: vscode: Configure read-only filesEnguerrand de Ribaucourt
When debugging or browsing files, the user may fall into external sources from other packages in the sysroot or dbg-rootfs. Modifying them will only lead to confusion since they will be overwritten by Yocto. The user should open them in a separate devtool modify session if they want to make changes. Meanwhile, we should prevent write access to them. Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20devtool: ide_sdk: Use bitbake's python3 for generated scriptsEnguerrand de Ribaucourt
The generated scripts use the sys.path configuration found inside bitbake. It can be a different python version than the one used on the host through the IDE. For instance, when running the generated script deploy_target_cmake-example-core2-64 from an eSDK generated on another machine, I got the following exception: AssertionError: SRE module mismatch We need to match the sys.executable to the sys.path. Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20recipetool; add support for python_mesonpy classTim Orling
* Add support to detect the "mesonpy" build-backend for recipetool create. * Add oe-selftest case for creating a recipe for "siphash24" from pypi. https://pypi.org/project/siphash24/ This is by far the simplest recipe using the mesonpy build backend. Upstream does not provide LICENSE file(s) and we do not detect the LICENSE so don't check for that result in the test. Likewise, upstream does not define HOMEPAGE, so skip that result. Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19lib/oe/patch: Use git notes to store the filenames for the patchesPeter Kjellerstedt
The old way of keeping track of the filenames for the patches that correspond to the commits was to add a special comment line to the end of the commit message, e.g., "%% original patch: <filename>", using a temporary git hook. This method had some drawbacks, e.g.: * It caused problems if one wanted to push the commits upstream as the comment line had to be manually removed. * The comment line would end up in patches if someone used git format-path rather than devtool finish to generate the patches. * The comment line could interfere with global Git hooks used to validate the format of the Git commit message. * When regenerating patches with `devtool finish --force-patch-refresh`, the process typically resulted in adding empty lines to the end of the commit messages in the updated patches. A better way of keeping track of the patch filenames is to use Git notes. This way the commit messages remain unaffected, but the information is still shown when, e.g., doing `git log`. A special Git notes space, refs/notes/devtool, is used to not intefere with the default Git notes. It is configured to be shown in, e.g., `git log` and to survive rewrites (i.e., `git commit --amend` and `git rebase`). Since there is no longer any need for a temporary Git hook, the code that manipulated the .git/hooks directory has also been removed. To avoid potential problems due to global Git hooks, --no-verify was added to the `git commit` command. To not cause troubles for those who have done `devtool modify` for a recipe with the old solution and then do `devtool finish` with the new solution, the code will fall back to look for the old strings in the commit message if no Git note can be found. While not technically motivated like above, the way to keep track of ignored commits is also changed to use Git notes to avoid having different methods to store similar information. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19devtool: Make use of oe.patch.GitApplyTree.commitIgnored()Peter Kjellerstedt
This makes use of the oe.patch.GitApplyTree.commitIgnored() function to create commits that shall be ignored by `devtool finish`. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19oe-setup-build: add a tool for discovering config templates and setting up ↵Alexander Kanavin
builds This is another piece of the puzzle in setting up builds from nothing without having to write custom scripts or use external tools. After layers have been fetched and placed into their respective locations by oe-setup-layers, one would surely want to proceed to the actual build, and here's how: 1. Without arguments the tool reads available layers from .oe-layers.json file (written out by oe-setup-layers or a fallback under scripts/), prints what templates it has found, and asks the user to select one, as seen below. This will land the user in a shell ready to run bitbake: ============================================= alex@Zen2:/srv/work/alex$ ./setup-build Available build configurations: 1. alex-configuration-gadget This configuration will set up a build for the purposes of supporting gadget. 2. alex-configuration-gizmo This configuration allows building a gizmo. 3. poky-default This is the default build configuration for the Poky reference distribution. Re-run with 'list -v' to see additional information. Please choose a configuration by its number: 1 Running: TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/configuration-gadget . /srv/work/alex/poky/oe-init-build-env /srv/work/alex/build-alex-configuration-gadget && /bin/bash You had no conf/local.conf file. This configuration file has therefore been created for you from /srv/work/alex/meta-alex/conf/templates/configuration-gadget/local.conf.sample You may wish to edit it to, for example, select a different MACHINE (target hardware). You had no conf/bblayers.conf file. This configuration file has therefore been created for you from /srv/work/alex/meta-alex/conf/templates/configuration-gadget/bblayers.conf.sample To add additional metadata layers into your configuration please add entries to conf/bblayers.conf. The Yocto Project has extensive documentation about OE including a reference manual which can be found at: https://docs.yoctoproject.org For more information about OpenEmbedded see the website: https://www.openembedded.org/ This configuration will set up a build for the purposes of supporting gadget. Please refer to meta-alex/README for additional details and available bitbake targets. ============================================== 2. It is also possible to list available configurations without selecting one using 'setup-build list' or to select and setup one non-interactively with 'setup-build setup'. 3. The full set of command line options is: $ ./setup-build --help usage: setup-build [-h] [--layerlist LAYERLIST] {list,setup} ... A script that discovers available build configurations and sets up a build environment based on one of them. Run without arguments to choose one interactively. positional arguments: {list,setup} list List available configurations setup Set up a build environment and open a shell session with it, ready to run builds. optional arguments: -h, --help show this help message and exit --layerlist LAYERLIST Where to look for available layers (as written out by setup-layers script) (default is /srv/work/alex/.oe-layers.json). $ ./setup-build list --help usage: setup-build list [-h] [-v] optional arguments: -h, --help show this help message and exit -v Print detailed information and usage notes for each available build configuration. $ ./setup-build setup --help usage: setup-build setup [-h] [-c configuration_name] [-b build_path] [--no-shell] optional arguments: -h, --help show this help message and exit -c configuration_name Use a build configuration configuration_name to set up a build environment (run this script with 'list' to see what is available) -b build_path Set up a build directory in build_path (run this script with 'list -v' to see where it would be by default) --no-shell Create a build directory but do not start a shell session with the build environment from it. 4. There's an an added hint in oe-setup-layers about how to proceed (as it is really not user-friendly to fetch the layer repos successfully and then exit without a word), and a symlink to the script from the top level layer checkout directory. 5. The selftest to check layer setup has been adjusted to run a basic check for template discovery and build setup. The revision of poky to be cloned has been bumped to 4.1, as that's the first version with a default template in a standard location. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19scripts/oe-setup-builddir: add support for configuration summariesAlexander Kanavin
They are handled exactly same as conf-notes.txt. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19patchtest: add stronger indication for failed testsSimone Weiß
Do not only log that there has been an issue but add WARNING before for local runs. Hopefully this helps to avoid that people reading the log to quickly miss issues. Fixes [YOCTO #15389] Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19scripts/oe-setup-layers: write a list of layer paths into the checkout's top dirAlexander Kanavin
This is beneficial for setting up builds, as this list can be used to determine reliably where the actual layers are, and discover available configurations from them. Also adjust the selftest to check the presence of that file rather than any specific layer in a hardcoded location. Sample output (paths are written relative to the file for relocatability and ease of reading): { "layers": [ "meta-openembedded/meta-filesystems", "meta-openembedded/meta-gnome", "meta-openembedded/meta-initramfs", "meta-openembedded/meta-multimedia", "meta-openembedded/meta-networking", "meta-openembedded/meta-oe", "meta-openembedded/meta-perl", "meta-openembedded/meta-python", "meta-openembedded/meta-webserver", "meta-openembedded/meta-xfce", "poky/bitbake/lib/layerindexlib/tests/testdata/layer1", "poky/bitbake/lib/layerindexlib/tests/testdata/layer2", "poky/bitbake/lib/layerindexlib/tests/testdata/layer3", "poky/bitbake/lib/layerindexlib/tests/testdata/layer4", "poky/meta-poky", "poky/meta-selftest", "poky/meta-skeleton", "poky/meta-yocto-bsp", "poky/meta" ], "version": "1.0" } Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19oe-init-build-env: generate .vscode from templateAdrian Freihofer
Provide a reasonable default configuration for VSCode and the yocto.bitbake extension. The generated default configuration is generic and minimal. It's mostly supposed to prevent VSCode from OOM exceptions if the build directory is in the scope of the indexer plugins of VSCode. But it also configures the yocto-bitbake plugin to just work without manual user interaction. The configuration is only generated if VSCode is installed. Currently, VSCode is one of many popular editors for Yocto/OE. Removing the check would mean that the configuration would be generated by e.g. oe-selftest or for users not using VSCode. If it should prove useful, the check can be removed later. Customization for other layers is possible. A layer might provide it's own oe-setup-build-env script which calls the oe-setup-vscode script from poky with different folders. But it's also possible to override the oe-setup-vscode script by another layer with a custom implementation. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18devtool: _extract_source: Correct the removal of an old backup directoryPeter Kjellerstedt
Also correct the comment describing what is happening. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18devtool: standard: Add some missing whitespacePeter Kjellerstedt
Makes it a little bit easier when reading the code. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18devtool: ide-sdk make deploy-target quickerAdrian Freihofer
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-02-18devtool: new ide-sdk pluginAdrian Freihofer
The new devtool ide plugin provides the eSDK and configures an IDE to work with the eSDK. In doing so, bitbake should be used to generate the IDE configuration and update the SDK, but it should no longer play a role when working on the source code. The work on the source code should take place exclusively with the IDE, which, for example, calls cmake directly to compile the code and execute the unit tests from the IDE. The plugin works for recipes inheriting the cmake or the meson bbclass. Support for more programming languages and build tools may be added in the future. There are various IDEs that can be used for the development of embedded Linux applications. Therefore, devtool ide-sdk, like devtool itself, supports plugins to support IDEs. VSCode is the default IDE for this first implementation. Additionally, some generic helper scripts can be generated with --ide none instead of a specific IDE configuration. This can be used for any IDE that supports calling some scripts. There are two different modes supported: - devtool modify mode (default): devtool ide-sdk configures the IDE to manage the build-tool used by the recipe (e.g. cmake or meson). The workflow looks like: $ devtool modify a-recipe $ devtool ide-sdk a-recipe a-image $ code "$BUILDDIR/workspace/sources/a-recipe" Work in VSCode, after installing the proposed plugins Deploying the artifacts to the target device and running a remote debugging session is supported as well. This first implementation still calls bitbake and devtool to copy the binary artifacts to the target device. In contrast to compiling, installation and copying must be performed with the file rights of the target device. The pseudo tool must be used for this. Therefore bitbake -c install a-recipe && devtool deploy-target a-recipe are called by the IDE for the deployment. This might be improved later on. Executing the unit tests out of the IDE is supported via Qemu user if the build tool supports that. CMake (if cmake-qemu.bbclass is inherited) and Meson support Qemu usermode. - Shared sysroots mode: bootstraps the eSDK with shared sysroots for all the recipes passed to devtool ide-sdk. This is basically a wrapper for bitbake meta-ide-support && bitbake build-sysroots. The workflow looks like: $ devtool ide-sdk --share-sysroots a-recipe another-recipe vscode where/the/sources/are If the IDE and the build tool support it, the IDE gets configured to offer the cross tool-chain provided by the eSDK. In case of VSCode and cmake a cmake-kit is generated. This offers to use the cross tool-chain from the UI of the IDE. Many thanks to Enguerrand de Ribaucourt for testing and bug fixing. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-02-17sstate-cache-management: fix regex for 'sigdata' stamp filesAndré Draszik
Given file names like 6.4.do_fetch.sigdata.821b6c62f9f2bd8b7e1378656b8319697a21f6f6e4a351f98dc325a18ef7ed0f, I'm pretty sure we want to match the dot here, not any character. Fixes: 2fa1b25d7485 ("sstate-cache-management: Rewrite in python") in oe-core Fixes: b723fcaac52f ("sstate-cache-management: Rewrite in python") in poky Signed-off-by: André Draszik <andre.draszik@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-16patchtest-send-results: add --debug optionTrevor Gamblin
Add a -d/--debug option to patchtest-send-results so that the contents of the constructed raw email can be checked without actually sending anything to the list or patch author. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-16patchtest: Fix grammar in log outputTrevor Gamblin
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-16devtool: modify: Correct appending of type=git-dependency to URIsPeter Kjellerstedt
A missing space when using :append would lead to run-on URIs if there was no whitespace at the end of the original SRC_URI. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-15patchtest-send-results: use Message-ID directlyTrevor Gamblin
There's no need to use regex for extracting the Message-ID field from the patch email and mangle it by removing the angle brackets in the process. Pull it directly from the mbox so that Patchtest's replies have even fewer differences when compared to other replies. Also add a TODO so that it's clear this needs adjustment when full series support is added. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-15patchtest: log errors and failures at endSimone Weiß
At the moment, running patchtest locally will only print failures and errors to the log when the not passing test case is executed. This might lead to people overlooking issues with their patches, so print a log line at the end if testcases showed issues. This should make it more easy to spot then before. Fixes [YOCTO #15389] Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-13scripts: python 3.12 regexAdrian Freihofer
All the regexes throw a warning like this: WARNING: scripts/lib/recipetool/create_buildsys.py:140: SyntaxWarning: invalid escape sequence '\s' proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-10patchtest-send-results: Add 'References' headerTrevor Gamblin
Based on https://www.rfc-editor.org/rfc/rfc2822#section-3.6.4, to get proper threading there should be a 'References' field defined in Patchtest's response headers if its replies are going to thread properly on Patchwork. This wasn't there before, hence why were were seeing the responses in the right place on the mailing list but not Patchwork. Since we only want Patchtest to reply directly to the tested patch, the 'References' field should only need to contain the same ID as the 'In-Reply-To' one. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-10recipetool: don't dump stack traces if a toml parser can't be foundRoss Burton
If we can't find tomllib or tomli then we can just tell the user politely that we can't parse the pyproject.toml file, there's no need to dump exception stack traces. Move the parser exception handler to catch the actual parse, as otherwise it will never be used. Whilst here, also add some debug statements to make it clear what of the handlers is being called. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08recipetool: cleanup importsAdrian Freihofer
- os is missing - glob is not used Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08wic: implement reproducible Disk GUIDAdithya Balakumar
GPT based disks have a disk guid apart from the 32-bit disk identifier. This commit implements reproducible disk guid by using SOURCE_DATE_EPOCH (if available) value as a random seed Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-06patchtest.README: update mailing listTrevor Gamblin
The contributing info still lists the main Yocto list, but patchtest is in oe-core, so simplify the instructions and put the right mailing list in. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-06patchtest-send-results: properly parse test statusAlexis Lothoré
patchtest-send-results currently search the word "FAIL" in the whole testresults file to decide whether it should send a report to patch submitter or not. This global search can lead to false positives, for example if the commit subject contains the word "FAIL" (as observed in [1]) Prevent those false positives by explicitely parsing the test status from each line. Each test result line, generated by the patchtest script, is expected to have the following format: <STATUS>: <some info, depending on the status> [1] https://lore.kernel.org/openembedded-core/0101018d79bfe020-06f2ce89-ea19-456b-92e7-66ee1c710fd1-000000@us-west-2.amazonses.com/ Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-06patchtest-send-results: remove unused variableAlexis Lothoré
result_basename is declared but not used in the script Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-02devtool: refactor deploy-targetAdrian Freihofer
Make the deploy function independent from d. This allows to call the function also from Python code not running in bitbake. This is needed to for the devtool ide plugin which will call the do_install task and the code from devtool deploy-target independently from a bitbake server. This allows a much quicker workflow. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-02devtool: refactor deploy to use exec_fakeroot_no_dAdrian Freihofer
This is a step towards a deploy function which can be called without passing the d variable. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-02devtool: refactor exec_fakerootAdrian Freihofer
Provide a function exec_fakeroot_no_d which does the same like exec_fakeroot does, but is usable independenlty from bitbake. This allows to use the fanction from scripts where the d variable is not available. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-02devtool: support plugins with pluginsAdrian Freihofer
Pass the plugins search path to plugins via context. This allows plugins to search for their own plugins at the same paths. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-24devtool: modify: add support for multiple source in SRC_URIJulien Stephan
[YOCTO #15162] when doing devtool modify, sources are extracted into a devtool temporary workdir. The main source is moved inside build/workspace/sources/${BPN}/ and local files are moved inside build/workspace/sources/${BPN}/oe-local-files. Secondary sources are currently not handled and are lost. Here is the output of devtool modify/build on bzip2 recipe: NOTE: bzip2: compiling from external source tree <...>/build/workspace/sources/bzip2 ERROR: bzip2-1.0.8-r0 do_install_ptest_base: ExecutionError('<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368', 1, None, None) ERROR: Logfile of failure stored in: <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/log.do_install_ptest_base.3368 Log data follows: | DEBUG: Executing shell function do_install_ptest_base | NOTE: make -j 16 DESTDIR=<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest install-ptest | sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \ | ../../../../../../workspace/sources/bzip2/Makefile.am > <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/Makefile | cp ../../../../../../workspace/sources/bzip2/sample1.ref <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample2.ref <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample3.ref <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample1.bz2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample2.bz2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample3.bz2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | ln -s /usr/bin/bzip2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/bzip2 | cp: cannot stat '<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/git/commons-compress': No such file or directory | WARNING: <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368:189 exit 1 from 'cp -r <...>/build/tmp/work/core2-64-poky-linux/bzip2/ 1.0.8/git/commons-compress <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/bzip2-tests/commons-compress' | WARNING: Backtrace (BB generated script): | #1: do_install_ptest, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 189 | #2: do_install_ptest_base, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 158 | #3: main, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 226 ERROR: Task (<...>/poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb:do_install_ptest_base) failed with exit code '1' NOTE: Tasks Summary: Attempted 776 tasks of which 765 didn't need to be rerun and 1 failed. Summary: 1 task failed: <...>/poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb:do_install_ptest_base externalsrc class modify SRC_URI to keep only: * 'file', 'npmsw' and 'crate' sources * url with type parameter matching 'kmeta' or 'git-dependency' So by forcing to add type='git-dependency' on secondary sources, we ensure that when building the recipe, the secondary sources can be unpacked into WORKDIR. This allows recipes containing several sources to be built under a devtool context, but it has some limitations: * user would not be able to generate patches for the secondary sources * type="git-dependency" is added for secondary sources even on non git sources, so we may want to rename this parameter Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19recipetool: Disregard version in URL for replaced modulesVyacheslav Yurkov
Major module version is a part of name, but not necessary part of the actual URL (See https://go.dev/ref/mod#module-path). Nevertheless, name detection function can't handle that suffix, so get rid of it to determine component name. For replaced modules that name might be different that the actual module name defined in go.mod file. Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19recipetool: Proceed even with a missing license fileVyacheslav Yurkov
Whenever the recipe uses a CLOSED license, the list is going to be empty. It's a discouraged practice not to have a license, but proceed anyway to finish recipe generation. Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>