summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2024-01-19recipetool: Don't fail on local go modulesVyacheslav Yurkov
Local modules are usually referenced with a 'replace' directive in go.mod file. If that's the case, remove them from populating SRC_URI. Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-09devtool/standard: correctly escape \Alexander Kanavin
python 3.12 points out that: SyntaxWarning: invalid escape sequence '\*' Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-07devtool: modify: fix exceptionJamin Lin
Root Cause: initial_revs is an empty dictionary and do not have "." key. Traceback (most recent call last): File "scripts/devtool", line 349, in <module> ret = main() File "scripts/devtool", line 336, in main ret = args.func(args, config, basepath, workspace) File "scripts/lib/devtool/standard.py", line 922, in modify if not initial_revs["."]: KeyError: '.' Solution: check key exists, then get its value. Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-04runqemu: match .rootfs. in addition to -image- for rootfsMikko Rapeli
Also change path.exists() and !path.isdir() to a single path.isfile() which should be equal. Enables running tests against image recipes which are not called "bla-image" but plain "bla". Currently they fail with do_testimage/runqemu error: runqemu - ERROR - Unknown path arg /home/builder/src/base/build/tmp_qemuarm64/deploy/images/qemuarm64/img-qemuarm64.rootfs.wic Suggested-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-02scripts/runqemu: fix regex escape sequencesTrevor Gamblin
When invoking runqemu with Python 3.12, the following warning is encountered: |SyntaxWarning: invalid escape sequence '\.' This is because the interpreter scans the string before it is processed by the regex module, and it interprets the backslash as part of an escape sequence, but not a standard one. This will be registered as an error rather than a warning in future Python versions. To avoid the it, simply add an extra backslash so that Python doesn't misinterpret the string, while the regex parser still sees an escaped '.' character. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-02devtool: use straight print in check-upgrade-status outputChen Qi
'devtool check-upgrade-status' is for reporting upgradable status for recipes. The output should always be printed out. So we should just use 'print' instead of 'logger.info' as the latter will be suppressed if '-q' parameter is supplied to devtool. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-28scripts: Drop shell sstate-cache-managementRichard Purdie
Since there is a faster python version, drop the slower shell one. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-28sstate-cache-management: Rewrite in pythonAlex Kiernan
This (should be) a drop in replacement for sstate-cache-management.sh. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-12-23devtool: deploy: provide max_process to strip_execsClay Chang
Use oe.utils.get_bb_number_threads to get max_process Signed-off-by: Clay Chang <clayc@hpe.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-21wic: use E2FSPROGS_FAKE_TIME and hash_seed to generate reproducible ext4 imagesvenkata pyla
E2FSPROGS_FAKE_TIME: sets fixed times for the inodes in the file system. hash_seed: creates reproducible directory indexes in the file system. Reference commit in e2fsprogs: e1f7100643a46456be107b33098f6034b0835e6d Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17recipetool: add python_maturin supportTim Orling
Add the new python_maturin PEP-517 backend Add selftest for 'pydantic-core' pypi package. Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-16devtool: modify: Handle recipes with a menuconfig task correctlyPeter Kjellerstedt
This avoids the following error when running `devtool modify` on a recipe that has a menuconfig task, but does not have KCONFIG_CONFIG_ENABLE_MENUCONFIG set. .../temp/run.do_configure.4163366: line 152: ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') }: bad substitution WARNING: .../temp/run.do_configure.4163366:152 exit 1 from '[ ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') } = True ]' Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15runqemu: add qmp socket supportRoss Burton
Add support for qmp sockets and defaults to unix:qmp.sock if unspecified Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09recipetool: pypi: do not clobber SRC_URI checksumsTim Orling
The pypi change: "85a2a6f68af recipetool: create_buildsys_python: add pypi support" deleted all the SRC_URI variables, including the SRC_URI checksums. These are not generated by the pypi.bbclass (how could they be trusted?) Without the checksum(s), we are vulnerable to a man-in-the-middle attack and zero checks on the validity of the downloaded tarball from pypi.org. Fix by only setting S and SRC_URI to None. Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08devtool: modify: Make --no-extract work againPeter Kjellerstedt
This avoids the following error when using --no-extract, introduced in commit 900129cbdf (devtool: add support for git submodules): Traceback (most recent call last): File ".../scripts/devtool", line 349, in <module> ret = main() File ".../scripts/devtool", line 336, in main ret = args.func(args, config, basepath, workspace) File ".../scripts/lib/devtool/standard.py", line 995, in modify for commit in commits[name]: KeyError: '.' 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>
2023-12-08devtool: upgrade: Update all existing checksums for the SRC_URIPeter Kjellerstedt
In addition to updating the sha256sum and removing the md5sum, update all other existing checksums. If the only existing checksum is md5sum, then replace it with the default expected checksums (currently only sha256sum). 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>
2023-12-08recipetool: create: Only include the expected SRC_URI checksumsPeter Kjellerstedt
Rather than including all SRC_URI checksums, include the ones that are expected. These are the same as are output if no checksums are included when building the recipe. 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>
2023-12-08recipetool: create: Improve identification of licensesPeter Kjellerstedt
Rather than having a static list of crunched MD5 checksums for some of the most common licenses, calculate it for all common licenses. This should improve the identification of license text variantions. 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>
2023-12-08update_gtk_icon_cache: Fix for GTK4-only buildsZoltan Boszormenyi
Try to execute both gtk-update-icon-cache and gtk4-update-icon-cache after checking whether the commands are available. This attempts to match what gtk-icon-cache.bbclass is doing. This fixes running update_gtk_icon_cache during do_rootfs for an image that contains only GTK4 related packages. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06recipetool: appendsrcfile(s): add a mode to update the recipe itselfJulien Stephan
Add a new option -u/--update-recipe to update the recipe itself instead of creating/updating a bbappend file 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>
2023-12-06recipetool: appendsrcfile(s): use params instead of extralineJulien Stephan
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) 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>
2023-12-06recipetool: appendsrcfile(s): add dry-run modeJulien Stephan
Add dry-run mode for recipetool appendsrcfile and appendsrcfiles, with if necessary, a diff of changes 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>
2023-12-06wic: extend empty plugin with options to write zeros to partitonMalte Schmidt
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'. 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>
2023-12-06recipetool: create_buildsys_python: add pypi supportJulien Stephan
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/<...> 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>
2023-12-06recipetool: create: add new optional process_url callback for pluginsJulien Stephan
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 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>
2023-12-06recipetool: create: add trailing newlinesJulien Stephan
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 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>
2023-12-06recipetool: create_buildsys_python.py: initialize metadataJulien Stephan
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 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>
2023-12-04wic: bootimg-efi: Make kernel image installation configurableKareem Zarka
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. 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>
2023-12-01devtool: add support for git submodulesJulien Stephan
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 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>
2023-12-01devtool: tag all submodulesJulien Stephan
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 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>
2023-12-01devtool: finish/update-recipe: restrict mode srcrev to recipes fetched from SCMJulien Stephan
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. 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>
2023-11-30devtool: fix update-recipe dry-run modeJulien Stephan
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 Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-11-27wic: rawcopy: add support for zstd decompressionMalte Schmidt
Add support for zstd decompression in rawcopy plugin. zstd claims to reach higher, uniform decompression rates. 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>
2023-11-06recipetool: Add handler to create go recipesLukas Funke
[RP: Replace python 3.9 use of removeprefix()] Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-06recipetool: Ignore *.go files while scanning for licensesLukas Funke
Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05scripts/resulttool: group all regressions in regression reportAlexis Lothoré
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 Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05scripts/esdk-tools: use a dedicated, static directory for esdk toolsAlexander Kanavin
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. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-02patchtest-send-results: fix sender parsingTrevor Gamblin
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. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-01patchtest-send-results: add In-Reply-ToTrevor Gamblin
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. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30patchtest-send-results: send results to submitterTrevor Gamblin
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. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30scripts/contrib/patchreview: fix commit identificationRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30recipetool: add python_hatchling supportTim Orling
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. Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27scripts/contrib/patchreview: consolidate importsRoss Burton
Move most imports to the top of the file. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27scripts/contrib/patchreview: add commit and recipe count fields to JSONRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27scripts/patchreview: rework patch detectionRoss Burton
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 Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27lib/oe/sstatesig.py: dump locked.sigs.inc only when explicitly asked via -S ↵Alexander Kanavin
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. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27recipetool/create_buildsys_python: add PEP517 supportJulien Stephan
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/ 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>
2023-10-27recipetool/create_buildsys_python: refactor code for futur PEP517 additionJulien Stephan
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 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>
2023-10-27recipetool/create_buildsys_python: prefix created recipes with python3-Julien Stephan
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 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>
2023-10-27recipetool/create_buildsys_python: fix license noteJulien Stephan
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 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>