summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* recipetool: appendsrcfile(s): add a mode to update the recipe itselfJulien Stephan2023-12-061-1/+5
| | | | | | | | | | | Add a new option -u/--update-recipe to update the recipe itself instead of creating/updating a bbappend file (From OE-Core rev: c9a80f55ed0bf9ce249205d6a9ba670fbb7f59ba) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: appendsrcfile(s): use params instead of extralineJulien Stephan2023-12-061-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appendsrc function relies on oe.recipeutils.bbappend_recipe to copy files and add the corresponding entries in SRC_URI. Currently, appendsrc function build itself the new SRC_URI entry to add the correct subdir param, and gives it using the extralines parameter. This has 2 drawbacks: - oe.recipeutils.bbappend_recipe can already do this if we specify the correct params, so we have duplicate code - the duplicated code is not fully functional: for example, it doesn't take into account the -m/--machine parameter So fix this by not using extralines but give correctly formatted params. Also remove the check for already existing entries as oe.recipeutils.bbappend_recipe already implement it The new bbappend file now have the SRC_URI entry after the FILESEXTRAPATHS so fix the selftest. Update test_recipetool_appendsrcfile_existing_in_src_uri_diff_params test because recipetool appendsrcfiles used to not add new src_uri entry if the entry already exist even with different parameters while oe.recipeutils.bbappend_recipe adds it if parameters are different (and remove the old entry) (From OE-Core rev: cd5de8d53849a6f3bb6f82e45fb301e39892c789) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: appendsrcfile(s): add dry-run modeJulien Stephan2023-12-061-1/+32
| | | | | | | | | | | Add dry-run mode for recipetool appendsrcfile and appendsrcfiles, with if necessary, a diff of changes (From OE-Core rev: 456c726e6b52f4dc57ff605e1cf1687097537002) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: extend empty plugin with options to write zeros to partitonMalte Schmidt2023-12-061-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds features to explicitly write zeros to the start of the partition. This is useful to overwrite old content like filesystem signatures which may be re-recognized otherwise. The new features can be enabled with '--soucreparams="[fill|size=<N>[S|s|K|k|M|G]][,][bs=<N>[S|s|K|k|M|G]]"' Conflicting or missing options throw errors. The features are: - fill Fill the entire partition with zeros. Requires '--fixed-size' option to be set. - size=<N>[S|s|K|k|M|G] Set the first N bytes of the partition to zero. Default unit is 'K'. - bs=<N>[S|s|K|k|M|G] Write at most N bytes at a time during source file creation. Defaults to '1M'. Default unit is 'K'. (From OE-Core rev: d19d4529e7a2056caeb526fed980cc1df19a5f6e) Signed-off-by: Malte Schmidt <malte.schmidt@weidmueller.com> Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create_buildsys_python: add pypi supportJulien Stephan2023-12-063-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, we can use devtool/recipetool to create recipes for python projects using the github url or the direct release tarball of the project, but the create_buildsys_python plugin doesn't support the pypi class, since we cannot know from the extracted source if the package is available on pypi or not. By implementing the new optional process_url callback, we can detect that the url is a pypi one (i.e 'https://pypi.org/project/<package>') and retrieve the release tarball location. Also detect if the url points to a release tarball hosted on "files.pythonhosted.iorg" (i.e https://files.pythonhosted.org/packages/...) In both cases, adds the pypi class, remove 'S' and 'SRC_URIxxx' variables from the created recipe as they will be handled by the pypi class and add the PYPI_PACKAGE variable This helps to produce cleaner recipes when package is hosted on pypi. If the url points to a github url or a release tarball not coming from "files.pythonhosted.org", the created recipe is the same as before. One can also use the newly added "--no-pypi" switch to NOT inherit from pypi class on matching url, to keep legacy behaviour. To create a recipe for a pypi package, one can now use one of the new following syntax (using recipetool create / devtool add): * recipetool create https://pypi.org/project/<package> * recipetool create https://pypi.org/project/<package>/<version> * recipetool create https://pypi.org/project/<package> --version <version> or the old syntax: * recipetool create https://files.pythonhosted.org/packages/<...> (From OE-Core rev: 097a43846cd99a7d74d004efc57f583ce78970a4) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: add new optional process_url callback for pluginsJulien Stephan2023-12-061-22/+32
| | | | | | | | | | | | | | | | | | | | | | | Add a new process_url callback that plugins can optionally implement if they which to handle url. Plugins can implement this callback for example, to: * transform the url * add special variables using extravalues * add extra classes * ... If a plugin handles the url, it must append 'url' to the handled list and must return the fetchuri No functional changes expected for plugins non implementing this optional callback (From OE-Core rev: 3e5ce351e7dbe283562bf1db1f2ce3b121c49b53) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: add trailing newlinesJulien Stephan2023-12-061-3/+5
| | | | | | | | | | | | | | create_recipe() function relies on oe.recipeutils.patch_recipe_lines() which relies on bb.utils.edit_metadata(). edit_metada expect lines to have trailing newlines, so add it to each lines before calling patch_recipe_lines, otherwise edit_metadata will not be able to squash blank line if there are two consecutive blanks after a removal (From OE-Core rev: 31b27cc76a1b669e2b126c332608fd772c124d69) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create_buildsys_python.py: initialize metadataJulien Stephan2023-12-061-0/+1
| | | | | | | | | | | | | In the case pyproject.toml doesn't contains metadatas, the metadata variable is not initialized and the plugin throws an error and falls back to another plugin, which is not the desired behaviour. So just ignore metadata if we don't have them (From OE-Core rev: 88d15877ba18309c521740d7a9649e14d77189bc) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: Make kernel image installation configurableKareem Zarka2023-12-041-3/+4
| | | | | | | | | | | | | | | | | | | | | The issue with installing the kernel image to both rootfs and boot partition is that some systems rely on the kernel image in rootfs and not in the boot partition. This leads to duplication of the kernel image, which can cause unnecessary storage usage. This patch provides a solution to the problem by adding a new parameter "install-kernel-into-boot-dir" to the wic kickstart file. If this parameter is set to 'true', the plugin will install the kernel image to the boot partition. If the parameter is set to 'false', the plugin will skip installing the kernel image, avoiding duplication. (From OE-Core rev: d3599afe5f604ea5afd9411e114934dcb52b2d48) Signed-off-by: Kareem Zarka <kareem.zarka@huawei.com> Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: add support for git submodulesJulien Stephan2023-12-014-125/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding the support of submodules required a lot of changes on the internal data structures: * initial_rev/startcommit used as a starting point for looking at new / updated commits was replaced by a dictionary where the keys are the submodule name ("." for main repo) and the values are the initial_rev/startcommit * the extractPatches function now extracts patch for the main repo and for all submodules and stores them in a hierarchical way describing the submodule path * store initial_rev/commit also for all submodules inside the recipe bbappend file * _export_patches now returns dictionaries that contains the 'patchdir' parameter (if any). This parameter is used to add the correct 'patchdir=' parameter on the recipe Also, recipe can extract a secondary git tree inside the workdir. By default, at the end of the do_patch function, there is a hook in devtool that commits everything that was modified to have a clean repository. It uses the command: "git add .; git commit ..." The issue here is that, it adds the secondary git tree as a submodule but in a wrong way. Doing "git add <git dir>" declares a submodule but do not adds a url associated to it, and all following "git submodule foreach" commands will fail. So detect that a git tree was extracted inside S and correctly add it using "git submodule add <url> <path>", so that it will be considered as a regular git submodule (From OE-Core rev: 900129cbdf25297a42ab5dbd02d1adbea405c935) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: tag all submodulesJulien Stephan2023-12-011-0/+3
| | | | | | | | | | | | In the case of a repository with submodules, we need to add the "devtool-base" and "devtool-patched" tag on all submodules in order to properly detect the added/removed/modified patches (From OE-Core rev: 241da68805d177d4ec4b302c8a997645cc645286) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: finish/update-recipe: restrict mode srcrev to recipes fetched from SCMJulien Stephan2023-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | When specifying --mode / -m srcrev with devtool finish/update-recipe on recipes that are not fetched from a SCM repository we get the following error: Traceback (most recent call last): [..] File "<...>/poky/meta/lib/oe/patch.py", line 49, in runcmd raise CmdError(cmd, exitstatus >> 8, "stdout: %s\nstderr: %s" % (stdout, stderr)) oe.patch.CmdError: Command Error: 'sh -c 'git format-patch --no-signature --no-numbered INVALID -o /tmp/oepatchbj7pfmzj -- .'' exited with 0 Output: stdout: stderr: fatal: bad revision 'INVALID' Fix this by adding a check and abort with a proper error message. (From OE-Core rev: 5b77f60e85d07921ae5e808daa1fd7d8c3dc40ea) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix update-recipe dry-run modeJulien Stephan2023-11-301-5/+4
| | | | | | | | | | | | | | | | | When running devtool update-recipe with --mode=srcrev AND --append switch in dry-run, we get the following error: Traceback (most recent call last): [...] Exception: destpath should be set here Fix this by removing a misplaced else statement in _update_recipe_srcrev (From OE-Core rev: 85ba125703d5b442133fd7c470b915460ee68ac9) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rawcopy: add support for zstd decompressionMalte Schmidt2023-11-271-1/+2
| | | | | | | | | | | Add support for zstd decompression in rawcopy plugin. zstd claims to reach higher, uniform decompression rates. (From OE-Core rev: 707471b71a417187f1e581d0c540e058825f7242) Signed-off-by: Malte Schmidt <malte.schmidt@weidmueller.com> Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Add handler to create go recipesLukas Funke2023-11-061-0/+751
| | | | | | | | [RP: Replace python 3.9 use of removeprefix()] (From OE-Core rev: 049afb933f42851d56d2e6522150a32bcccf2a6f) Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Ignore *.go files while scanning for licensesLukas Funke2023-11-061-1/+1
| | | | | | | (From OE-Core rev: 1765acc8bdc08e392daa8b77add8b4ce1a9e70b6) Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: group all regressions in regression reportAlexis Lothoré2023-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c304fcbe0588b1078373558c2ddf36064bcdf214 introduced a grouping when listing regressions. This grouping has been added only for ptests. It has been observed that any other kind of tests could benefit from it. For example, current regression reports can show the following: 1 regression(s) for oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_help oescripts.OEPybootchartguyTests.test_pybootchartguy_help: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output: PASSED -> SKIPPED 1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output: PASSED -> SKIPPED [...] This output is not so useful in its current state and should be grouped per test type too. Enable grouping for all kind of tests, to make it llok like the following in reports: 5 regression(s) for oescripts oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_help: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output: PASSED -> SKIPPED oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output: PASSED -> SKIPPED (From OE-Core rev: 982798ef96e3a32bf15341bdd3bb7c4356709412) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/esdk-tools: use a dedicated, static directory for esdk toolsAlexander Kanavin2023-11-0511-0/+11
| | | | | | | | | | | | This allows easier replication of esdk environment (which provides a curated, limited set of tools that for example does not include bitbake) in a standard yocto build. Switchover between various sets can be achieved via PATH manipulation. (From OE-Core rev: 20c548f2edca3888152adb63de7b23d84e3848e7) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest-send-results: fix sender parsingTrevor Gamblin2023-11-021-1/+1
| | | | | | | | | | | Not all mbox 'from' fields will contain angle brackets, so the re.findall invocation used for getting a reply_address may fail. Use a simpler reference to the field to get the sender's email address. (From OE-Core rev: 86e9afe09a346586114133f5a7470304d2ed733f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest-send-results: add In-Reply-ToTrevor Gamblin2023-11-011-18/+21
| | | | | | | | | | | Rework the script for sending results to use send_raw_email and specify the 'In-Reply-To' field so that patchtest replies to the emails, rather than sending them standalone to the submitter and mailing list. (From OE-Core rev: 0c45c92e7f26aea4edf2cfa577b7ba51384e59d3) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest-send-results: send results to submitterTrevor Gamblin2023-10-301-6/+13
| | | | | | | | | | | | | Modify patchtest-send-results so that it extracts the submitter's email address and responds to them with the patch testresults. Also make a minor adjustment to the suggestions provided with each email and include a link to the Patchtest wiki page for additional clarification on specific failures. (From OE-Core rev: 64ed88e32cf9e04772319ff6e66c602d1cff4fd7) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/contrib/patchreview: fix commit identificationRoss Burton2023-10-301-1/+1
| | | | | | | | | | | | | git show-ref looks at the _remote_ ref called HEAD, which is fine when it matches the local HEAD but problematic when you're iterating a series of commits. Use rev-parse to resolve the local name to a proper hash. (From OE-Core rev: 3c04747b681cf6090ba9c77752f6c2f304dbbe17) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add python_hatchling supportTim Orling2023-10-301-1/+5
| | | | | | | | | | | | One of the newer PEP-517 backends to be added was python_hatchling.bbclass but it was not included in the recent improvements. Add selftest for 'jsonschema' pypi package. (From OE-Core rev: d99b4883b4fee82bc588fd235ba90fedf1550cb8) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/contrib/patchreview: consolidate importsRoss Burton2023-10-271-5/+10
| | | | | | | | | Move most imports to the top of the file. (From OE-Core rev: d2c287db0739b249604cd1beaa03ec38512ba718) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/contrib/patchreview: add commit and recipe count fields to JSONRoss Burton2023-10-271-10/+22
| | | | | | | | | | | The autobuilder scripts post-process the generated JSON to inject recipe and commit counts into the data. We can do this easily in patchreview instead. (From OE-Core rev: 77c96e43090cbf485aec612cc2315b85e5635dda) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/patchreview: rework patch detectionRoss Burton2023-10-271-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | A previous patch[1] added the ability to allow the search pattern for patches to be changed, so that patchreview can be used across the entire meta-oe repository by changing the patterns. However, this means the caller needs to write long patterns when calling patchreview. Instead, we can see if the specified directory contains a layer by checking if conf/layer.conf exists. If it does, then search for patches inside this directory. If it doesn't, assume that the specified directory is a repository that contains sublayers (such as meta-openembedded) and look through each of the directories that match the pattern meta-*. This means patchreview can both scan either a single layer (eg .../poky/meta) or a repository of sublayers (eg .../meta-openembedded). [1] oe-core 599046ea9302af0cf856d3fcd827f6a2be75b7e1 (From OE-Core rev: a3a868519beab1b9cac94fefd7dbeffb09d047e9) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/sstatesig.py: dump locked.sigs.inc only when explicitly asked via -S ↵Alexander Kanavin2023-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | lockedsigs This was writing out locked-sigs.inc into cwd with every 'bitbake -S' invocation. When the intent is only to to get task stamps (-S none), or print the difference between them (-S printdiff), the file is unnecessary clutter. A couple of selftests/scripts were however relying on this, so they're adjusted to explicitly request the file. eSDK code calls dump_lockedsigs() separately via oe.copy_buildsystem.generate_locked_sigs() and so isn't affected. (From OE-Core rev: ad57c3cac2a8d3e60222e3cca0685f582dcea135) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: add PEP517 supportJulien Stephan2023-10-271-1/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic support for PEP517 [1] for the 3 following backends that are supported by bitbake: - setuptools.build_meta - poetry.core.masonry.api - flit_core.buildapi If a pyproject.toml file is found, use it to create the recipe, otherwise fallback to the old setup.py method. Some projects can declare a minimal pyproject.toml file, and put all the metadata in setup.py/setup.cfg/requirements.txt .. theses cases are not handled. If a pyproject.toml file is found, assumes it has all necessary metadata. As for the old setup.py method, version numbers for dependencies are not handled. Some features may be missing, such as the extra dependencies. [YOCTO #14737] [1]: https://peps.python.org/pep-0517/ (From OE-Core rev: c7d8d15b2d0a9ecd210bd247fa0df31d9f458873) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: refactor code for futur PEP517 additionJulien Stephan2023-10-271-349/+371
| | | | | | | | | | | | | | | | In order to prepare the support for pyproject.toml (PEP517 [1]) enabled projects, refactor the code and move setup.py specific code into a specific class in order to allow sharing the PythonRecipeHandler class No functionnal changes expected [1]: https://peps.python.org/pep-0517/#source-tree (From OE-Core rev: 2281e93347da4129062cfb40710df03c87c63168) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: prefix created recipes with python3-Julien Stephan2023-10-271-0/+5
| | | | | | | | | | | | | | | By convention, all python recipes start with "python3-" so update create_buildsys_python to do this This rule doesn't apply for packages already starting with "python" Update recipetool's selftest accordingly (From OE-Core rev: b0d87440e610b80f763d09784d4a90a148bb3e7b) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: fix license noteJulien Stephan2023-10-271-1/+1
| | | | | | | | | | | | | | | | | License field of setup is not always standardized, so we usually use the classifier to determine the correct license format to use in the recipe. A warning note is added above the LICENSE field of the create recipe in case a license is provided in setup. But when the plugin is called, "LICENSE =" is not yet present so we can never display this note. Replace the "LICENSE =" condition with "##LICENSE_PLACEHOLDER##" to actually be able to display the note message (From OE-Core rev: b7c26ca2028aa60f740464de85a11a01a531f32e) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest-send-results: check max line length, simplify responsesTrevor Gamblin2023-10-251-8/+9
| | | | | | | | | | | | | | Check that the maximum line length of the testresult file is less than 220 characters, to help guard against malicious changes being sent in email responses. If any line exceeds this length, replace the normal testresults used in the response with a line stating that tests failed, but the results could not be processed. Also clean up the respone substrings slightly to go along with the change. (From OE-Core rev: b0d53cf587dc9afb97f00c1089e45b758e96dd7c) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest-send-results: improve subject lineTrevor Gamblin2023-10-241-1/+6
| | | | | | | | | | | Pull the actual email's subject line from the .mbox file and use that in patchtest's test results response, so that it's clearer which patch it is replying to. (From OE-Core rev: 98ca0b151517b3544454fd5c1656a2de631c4897) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/yocto_testresults_query: add option to change display limitAlexis Lothoré2023-10-231-3/+10
| | | | | | | | | | | | | | | | Add a "-l"/"--limit" option to allow changing the display limit in resulttool. - If no value is passed, resulttool uses its default value. - If 0 is passed, the display limit is removed and every regression will be displayed - If a custom value is passed, this value overrides the vlaue configured in resulttool (From OE-Core rev: d3f536b3fc3f7027f6f5cf8bdaf5d7c050c7974b) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: make additional info more compactAlexis Lothoré2023-10-231-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since "matched" and "improved" tests are not as important as regressions, reduce the place they take in the regression report: - merge "matched" and "improved" tests, while removing the label - add a single line of additional info per pair Those changes make the "Matches and improvements" look like the following sample: oeselftest_almalinux-9.2_qemux86-64_20230910083156 oeselftest_almalinux-8.8_qemux86-64_20231018010951 -> +7 test(s) present oeselftest_almalinux-9.2_qemux86-64_20230911010538 oeselftest_debian-11_qemux86-64_20231017150459 oeselftest_debian-11_qemux86-64_20230910012927 oeselftest_debian-11_qemux86-64_20231017151319 -> +7 test(s) present [...] (From OE-Core rev: 6de4426d9a7da67deed7d3a3918892fb56238ff3) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: rearrange regressions report orderAlexis Lothoré2023-10-231-2/+6
| | | | | | | | | | | | | | Regressions reports currently reports matching pairs and improved pairs first, then regressions. Change order to print regressions first, which is the most valuable info in the report, and then print improvements and matches at the bottom. (From OE-Core rev: 599267467430e70fa4dc8ba6b2a8b126bf6da359) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/resulttool: limit the number of changes displayed per testAlexis Lothoré2023-10-231-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | Most of the changes list generated in regression reports fall in one of the two following categories: - there is only a few (<10) changes listed and the info is valuable/relevant - the list is huge (> 100 ? 1000 ?) and basically tells us that the whole tests category suffers the same status (test missing, test failing, test skipped, etc) Prevent those huge, worthless lists by limiting the output for each test group: - current default limit is arbitrarily set to 50 - limit can still be overriden with a new "-l"/"--limit" flag, either with custom value, or with 0 to print the whole lists of changes - limit is applied per test family: currently it distinguishes only types of ptests, but it can be adapted to other kind of tests (From OE-Core rev: cec118406f3ad81cb4709f6e6ae1cef65799658e) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: Add squashfs filesystem typesLogan Gunthorpe2023-10-231-1/+3
| | | | | | | | | | | | | When using a squashfs filesystem type, runqemu requires specifying the full path to the image because it doesn't list squashfs types in its fstypes variable. Add them to provide the same support as other filesystem types. (From OE-Core rev: c9c9a077e85b56f495f09187483548149f142a8d) Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bb-matrix-plot.sh: Show underscores correctly in labelsPeter Kjellerstedt2023-10-231-2/+2
| | | | | | | | | | | Underscores previously caused the next character in the label to be printed using subscript due to the enhanced string support in gnuplot. (From OE-Core rev: 282b48f90f77e0766993018d22fe03dd303febdc) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: sort when reading patches from a directoryRoss Burton2023-10-191-1/+1
| | | | | | | | | | | | | When reading patches from a directory it's important to sort the output of os.listdir(), as that returns the files in an effectively random order. We can't test the patches apply if they're applied in the wrong order, and typically patch filenames are prefixed with a counter to ensure the order is correct. (From OE-Core rev: 4d6b586d37ab4528ed6dae6779cd730af9ef09c2) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: remove unused importsRoss Burton2023-10-192-2/+0
| | | | | | | (From OE-Core rev: be8429d986335aae65c2426862b97836ba46e42a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: check for untracked changesTrevor Gamblin2023-10-191-0/+6
| | | | | | | | | | | | | | | | [YOCTO #15243] Avoid overwriting local changes when running patchtest by checking for anything unstaged or uncommitted in the target repo, and logging an error if something is found. This will provide the user helpful feedback if (for example) they forgot to commit a change for their patch under test, and will leave the target repository in a reasonable state (rather than a temporary branch created by patchtest). (From OE-Core rev: 2cc2dda6c3d5a97173b3fc434cc16ff2a930f43f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/bitbake-whatchanged: removeAlexander Kanavin2023-10-191-318/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not documented or tested, and indeed hasn't been producing useful reports for some time. The script works by redirecting STAMPS_DIR into a separate location, then running bitbake -S none, then comparing the two sets of stamp filenames with regexes: Match the stamp's filename group(1): PE_PV (may no PE) group(2): PR group(3): TASK group(4): HASH stamp_re = re.compile("(?P<pv>.*)-(?P<pr>r\d+)\.(?P<task>do_\w+)\.(?P<hash>[^\.]*)") Then there's some code that finds out what changed in the above between the two sets. Messing about with STAMPS_DIR like that isn't supported, and will either do nothing, or remove the original stamps. Also stamp filenames aren't really a 'public API'. For finding out the changes between two builds, 'bitbake -s printdiff' is a supported and tested option. It may be a bit too verbose, but that can be more easily fixed than rewriting bitbake-whatchanged into a working state. (From OE-Core rev: f8193978eb0944e693e6a5cfbf9035e104e489f0) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: update SPDX identifiersTrevor Gamblin2023-10-175-64/+6
| | | | | | | | | | Replace full license headers with SPDX identifiers and adjust all patchtest-related code to use GPL-2.0-only. (From OE-Core rev: 9bea6b39074296bb8d8719a3300636e316f19d1b) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: set default repo and testdir targetsTrevor Gamblin2023-10-172-6/+10
| | | | | | | | | | | | | | | | | Since patchtest is in oe-core, the Python os module's methods can be used to retrieve the repository path and tests directory by default. This reduces the number of mandatory arguments for invocation of patchtest unless the user wants to use a custom test suite or test patches against a different repo. The REPO and TESTDIR arguments are likewise adjusted so that they are optional. Also, make it more obvious what the --startdir flag is meant for on the command line by renaming it to --testdir, and update the scripts/patchtest.README file to be consistent with the new usage. (From OE-Core rev: bae7421ece4806f5148f164293810b9fe75e0756) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: add scripts to oe-coreTrevor Gamblin2023-10-176-0/+790
| | | | | | | | | | | | | | | | | | | | | | | | Add the following from the patchtest repo: - patchtest: core patch testing tool - patchtest-get-branch: determine the target branch of a patch - patchtest-get-series: pull patch series from Patchwork - patchtest-send-results: send test results to selected mailing list - patchtest-setup-sharedir: create sharedir for use with patchtest guest mode - patchtest.README: instructions for using patchtest based on the README in the original repository Note that the patchtest script was modified slightly from the repo version to retain compatibility with the oe-core changes. patchtest-send-results and patchtest-setup-sharedir are also primarily intended for automated testing in guest mode, but are added for consistency. (From OE-Core rev: cf318c3c05fc050b8c838c04f28797325c569c5c) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/patchreview: Add a custom pattern for finding recipe patchesMickael RAMILISON2023-10-151-1/+2
| | | | | | | | | | | | | This introduces support for specifying a search pattern with the -p/--pattern option in the patchreview.py script. This is designed to accommodate the directory structure of meta-openembedded. (From OE-Core rev: 599046ea9302af0cf856d3fcd827f6a2be75b7e1) Signed-off-by: Mickael RAMILISON <mickael.ramilison@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix a typo in help outputAndré Draszik2023-10-101-1/+1
| | | | | | | (From OE-Core rev: 1c35beb935d42e200370b54f9aa3848b940966dd) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu/qemurunner: Use nodelay with tcp serial connectionsRichard Purdie2023-10-101-2/+2
| | | | | | | | | This disables Nagle's algorithm for our tcp serial connections which may be causing data transfer issues. (From OE-Core rev: f8eff4c427881a98333fdf7c42f66ed6603e4f03) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/bblock: add a script to lock/unlock recipesJulien Stephan2023-10-091-0/+184
| | | | | | | | | | | | | | | | | | | | | | | | | bblock script allows to lock/unlock recipes to latest task signatures. The idea is to prevent some recipes to be rebuilt during development. For example when working on rust recipe, one may not want rust-native to be rebuilt. This tool can be used, with proper environment set up, using the following command: bblock <recipe_name> See help for more details if a <recipe_name>'s task signature change, this task will not be built again and sstate cache will be used. [YOCTO #13425] (From OE-Core rev: 2d9ab0cfd7f3cacc347954676f1323342a6b286f) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>