summaryrefslogtreecommitdiffstats
path: root/bitbake
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: doc: bitbake-user-manual-metadata: provide link to new docAntonin Godard22 hours1-5/+2
| | | | | | | | | | | Replace the now obsolete paragraph of the "Other Functions" section by a link to the new "Library Functions" document. (Bitbake rev: 0eecb4b2ee4fe5339340ed0d08783aa03bf051cc) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: doc: add a new Library Functions documentAntonin Godard22 hours3-0/+67
| | | | | | | | | | | | | | | | | | Add a new document to the BitBake user manual that automatically documents the library functions from their docstrings. The docstrings can be formatted in reStructuredText. Here logging utilities and the bb.utils module is documented. Some members of the utils module were deliberately excluded as their usage is most likely only internal to BitBake. Fixes [YOCTO #9612] (Bitbake rev: 0a711949acc2696f32a61c591ee3ea37041acb91) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb: format and improve logging docstringsAntonin Godard22 hours1-6/+70
| | | | | | | | | | | Format the docstrings of the utils modules to be automatically documented with the autodoc Sphinx extensions. (Bitbake rev: 4963bfc6045ad1f49e721edd97766dab1e2d1edc) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: utils: format and improve docstringsAntonin Godard22 hours1-148/+453
| | | | | | | | | | | | | Format the docstrings of the utils modules to be automatically documented with the autodoc Sphinx extensions. Sphinx syntax can be used in those for proper formatting. Cross-referencing with :term: is not possible in these. (Bitbake rev: 2fa1c7ad43639c6d25c94b7794bcce5f5ff74e10) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: utils: lock_timeout_nocheck() ensure `l` is initializedMark Asselstine22 hours1-0/+1
| | | | | | | | | | | | | lock_timeout_nocheck() can be interrupted immediately after enterring the try-block and prior to initializing 'l', for example with a ctrl-C, the code in finally will still be run and the 'if l' will fail. Initialize 'l' as False to avoid this possiblity. (Bitbake rev: 4885cd9d275ba2ab60e5c76aed856c34533cd3ae) Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: parse/ConfHandler: Add warning for deprecated whitespace usageRichard Purdie9 days1-2/+4
| | | | | | | | | | | | | | | A lack of whitespace around variable assignment operators makes the files harder to read. There is a deeper issue in that a "+" character can sometimes be confused between the variable name and the assignment operator. Start showing warnings for such usage so we encourage people to use consistent whitespace which helps with file readability in general. (Bitbake rev: 24772dd2ae6c0cd11540a260f15065f906fb0997) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: doc/bitbake-user-manual-metadata.rst: fix python task exampleAntonin Godard2025-04-101-2/+2
| | | | | | | | | | | | | | Fix the old Python 2 print statement, replace it by a bb.plain() call instead. Also replace time by datetime for a slightly simpler example. [YOCTO #14670] Reported-by: Robert Berger <pokylinux@reliableembeddedsystems.com> (Bitbake rev: 874c607f475f3d60677d2720b80a28d0c2e963c6) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: codeparser: Add function decorators for vardepsJoshua Watt2025-04-102-3/+44
| | | | | | | | | | | | Adds bb.parse.vardeps bb.parse.excludevardeps function decorators that can be used to explicitly add or exclude variables from a python function parsed by bitbake (Bitbake rev: 030fb3dee067640a3a50f24a53d200bdb5048376) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: correct typo in comment and stylePeter Marko2025-04-101-3/+3
| | | | | | | | | | | | Correct typo Fash -> Fast. With it also delete some trailing spaces which are unnecessary and editors are trying to remove when changing anything in the file. (Bitbake rev: b96040a0a066344527f0bc6ca4d09cda6b9d2f11) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: always fetch lfs when creating shallow tarballPeter Marko2025-04-101-3/+2
| | | | | | | | | | | | | | | | | | Before fast shallow tarballs the shallow tarball with lfs worked only if the original .../downloads/git2/... directory existed. Once it was not there, do_unpack on shallow tarball without lfs files failed due to disabled network. It was fixed for fast shallow tarballs and this commit fixes the other scenarios, too. This can happen when such shallow tarball is put to mirror or if someone does cleanup to reclaim disk space. (Bitbake rev: 4e6fb31a88448cdacf4e9f84cf0a8a8035f84d63) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: tests/fetch: Fix git PREMIRRORONLY testJulian Haller2025-04-101-3/+4
| | | | | | | | | | | | Using a shallow clone to simulate an outdated git mirror tarball does not work in the intended way. A shallow clone already contains the latest commit which can hide certain fetcher behavior. Simulate an outdated mirror tarball, as the test titles indicate, by removing the newer commits from the mirror. (Bitbake rev: a51ee01f0a586fefd5a4061f4a1ca6cbf81b7046) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fetch: Fix BB_FETCH_PREMIRRORONLY for git mirror tarballsJulian Haller2025-04-101-0/+4
| | | | | | | | | | | | | When invoking the original git fetcher after downloading a mirror tarball, BB_FETCH_PREMIRRORONLY is ignored. This leads to git fetch commands targeting the upstream source being executed silently. Ensure setting BB_NO_NETWORK before invoking the original fetcher. While this was only observed for git, setting this in general for all fetcher types makes sense at this location. (Bitbake rev: 1b1321f2b60c0a66159e3f20c6befcb0b3ccc4c7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Handle srcrevs for annotated tags in tag checkRichard Purdie2025-04-032-1/+13
| | | | | | | | | | | | | | If SRCREV points at an annotated tag, the comparision code can fail as the resolved tag might not be the same sha. Handle this by also resolving the SRCREV. We only need to do this if they don't match in the first place for a minor performance win. Also add a test for this. (Bitbake rev: 136c06e251de68ed64355ec6b47a522ff3a372e3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Update version to 2.12.0 for releaseRichard Purdie2025-03-292-2/+2
| | | | | | (Bitbake rev: 5b4e20377eea8d428edf1aeb2187c18f82ca6757) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: add a test for download paths without a proper filenameRoss Burton2025-03-272-0/+3534
| | | | | | | | | | | | | | | | | For example the miniupnpd recipe has a SRC_URI like this: http://miniupnp.tuxfamily.org/files/download.php?file=${BP}.tar.gz In this case the path is /files/download.php, which isn't useful when the latest_upstream logic bails early if there is no version in the path. The logic now also checks in the downloadfilename, so add a test that this works as expected. (Bitbake rev: fffbf5d5e1c8556cddf0794e0b303bb0106747a0) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: support setting PV in the wget fetcherRoss Burton2025-03-271-1/+2
| | | | | | | | | Some code paths in latest_versionstring() need PV to be set correctly. (Bitbake rev: 0a9f90ff658e09feda63b398ec35715a65ff6193) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: use a namedtuple for the wget test dataRoss Burton2025-03-271-22/+24
| | | | | | | | | | Use a named tuple so the test can access named members instead of just accessing the data via index, which is harder to understand. (Bitbake rev: 4b15652c84b06f0506c757e2647875a9b1cc7bfe) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb/tests: use subtests when looping in a test caseRoss Burton2025-03-271-32/+35
| | | | | | | | | | Marking the test iterations as subtests means that when one fails, it can identify clearly which iteration has failed. (Bitbake rev: 52c55e681332d7cdbe06f3c9d9c8d77cb0cb93f6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget: use long arguments for clarityRoss Burton2025-03-271-5/+5
| | | | | | | | | | | It's best practise to use long-form arguments in scripts where the conciseness of short arguments is less useful than in an interactive terminal. (Bitbake rev: 54039bc9d169871af6d36578df4c21bff296f6de) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget: don't conditionalise --continueRoss Burton2025-03-271-6/+1
| | | | | | | | | | | | If the target file exists, we pass --continue so that wget will try to resume the download instead of starting from the beginning. However if the file doesn't exist --continue has no effect, so there's no need to conditionalise the use of the argument. (Bitbake rev: a5ee50d4d2b2e6c00abe1551382afd9799345dbf) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget: consider downloadfilename when checking for upstreamRoss Burton2025-03-271-1/+5
| | | | | | | | | | | | | | | | | | | | | latest_versionstring() currently looks at just the end of the URI when guessing what the filename to look for is, but this doesn't work if the URL filename is not simple. For example, miniupnpd has a SRC_URI of: http://miniupnp.tuxfamily.org/files/download.php?file=${BP}.tar.gz;downloadfilename=${BP}.tar.gz The filename component of this is "download.php", which causes the heuristics in latest_versionstring() to exit early. Instead, if the downloadfilename is set then use that, as it's often the actual filename that we're after. (Bitbake rev: 2d5f135e997d13fabda0ad266fd5c928ee33f487) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/gomod: Fix mirroring problemChristian Lindeberg2025-03-272-13/+31
| | | | | | | | | | | | Build the 'downloadfilename' parameter by replacing path separators in the module path like the git fetcher builds the mirror tar ball name. Copy the downloaded file in the fetcher's unpack method like the crate fetcher instead of calling the base fetcher's unpack method. (Bitbake rev: 7762cea087597019460d66b04268757bd46befdf) Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Bump version to 2.9.2Richard Purdie2025-03-252-2/+2
| | | | | | | | | After the fetcher revisions changes, we need a new version marker to match this with in OE-Core. (Bitbake rev: 8cc976e2792fdde3900729f3b09dd18ab640b5e8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Revert "bblayers/query: Fix using "removeprefix" string method"Richard Purdie2025-03-241-2/+1
| | | | | | | | This reverts commit 004cfdec1c865f2351bbac99acb3d63bfef9d380. Now we have python 3.9 as a minimum we can do this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch: Drop multiple branch/revision support for single git urlsRichard Purdie2025-03-205-281/+139
| | | | | | | | | | | | | | | | | We used to use this for bare clones where a single git url could handle multiple revisions (which implied multiple branches). We don't use this any more and I doubt we'd want to go back to it. If we remove it, we can simplfy the looping in the code which seems desireable. This patch does change the warning for missing branch parameters to a error. The message has hinted about that for long enough. Some test cases are removed since they are no longer needed. (Bitbake rev: 2515fbd10824005fa7f34e87706000c079920366) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb: Bump minimum python version requirement to 3.9Richard Purdie2025-03-201-2/+2
| | | | | | | | | | | | | Since Ubuntu 20.04 is heading to EoL and that we're having other issues on that platform needing buildtools anyway, we're about to lose the last python 3.8 platform we were supporting. Bump the minimum version to 3.9 since there are many developers wanting access to newer python features. (Bitbake rev: 0d2e682d00dfc2ec776b3a89f25202db98024895) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Fix typo in npm testRichard Purdie2025-03-191-1/+1
| | | | | | (Bitbake rev: 79b04f61236117d310c12c1b1378ae63afb931ff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Add git tag verification testsRichard Purdie2025-03-191-0/+59
| | | | | | | | Add tests for git tag verification in both standard and shallow clones. (Bitbake rev: f47127066d67e2ad80974fa1e7c0fcc7409161af) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Ensure tags work with shallow clonesRichard Purdie2025-03-191-0/+2
| | | | | | | | | | If we want to validate a tag when using shallow clones, we need to ensure the tag is imported to the clone. Adding to extra_refs allows this to happen ensuring tag validation in shallow clones works. (Bitbake rev: 03945475886b8d31c7eccc80fe594ab5306bcf5d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Rework tag parameter handlingRichard Purdie2025-03-193-14/+17
| | | | | | | | | | | | | | | | | | | | | | Currently bitbake disallows tag parameters along with revision parameters. This isn't great since quite often, we'd like to verify that a given revision does match some tag. At the same time we don't want to or need to access the network to verify this, which normally a tag would require. Rework the code so that tag and revisions can both be specified together. Verify that any tag specified matches the revision in use at unpack time. This means we can start requiring people to put tags in git SRC_URIs when revisions are used, making review a little easier that it isn't some random revision. The test that is dropped looks like a different test but the comment is a copy and paste error. The SRCREV/rev mismatch test remains, this removes the rev and tag set test. (Bitbake rev: d591d7633fe8d739ec00395920e44910b0b77e27) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Add missing branch parameter to testsRichard Purdie2025-03-191-23/+23
| | | | | | (Bitbake rev: fd01e8e3a5a757d5f506095fc1ac4e45d888ae78) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tinfoil: Track data during finalizeDataYoann Congal2025-03-181-1/+2
| | | | | | | | | | | | finalizeData changes the value of variables, so, it needs to have data tracking enabled to get a full and accurate variable value history. Fixes [YOCTO #15652] (Bitbake rev: 228979b506f7d0e24c643440bcc7becf684da283) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tinfoil: Refactor temporary data tracking in a context managerYoann Congal2025-03-181-7/+18
| | | | | | | | | | | | | | | A new context manager Tinfoil._data_tracked_if_enabled() is introduced to replace the following structure: if self.tracking: self.run_command('enableDataTracking') # Code that need data tracking if self.tracking: self.run_command('disableDataTracking') (Bitbake rev: 0fea4555d2143c6b23a79d3d5cf791103a68141b) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Restore escape quoting for the git url when usedPatrik Nordvall2025-03-182-1/+5
| | | | | | | | | | | | | | | | | | | | | | This fixes a bug where escapes in the url path would not be properly restored for the git commands in the git fetcher. For example, a space which is encoded as '%20' was not properly encoded before the clone command. e.g. SRC_URI="git://git.openembedded.org/bitbake%20example/bitbake;protocol=https" resulted in git clone 'https://git.openembedded.org/bitbake example/bitbake' instead of git clone 'https://git.openembedded.org/bitbake%20example/bitbake' (Bitbake rev: be48024253b93215bb110cd1d05925e789ec9680) Signed-off-by: Patrik Nordvall <patrik.nordvall95@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: data_smart: Ensure module dependency changes invalidate the base ↵Richard Purdie2025-03-131-0/+5
| | | | | | | | | | | | | | | | | config cache Changing module files was changing the tash hashes but it was not invalidating the parse cache, leading to tashhash mismatch errors during builds. Add information from modulecode_deps to the configuration hash used for cache invalidation to avoid this and trigger reparses when function library code changes. [YOCTO #15795] (Bitbake rev: a121db3d8d28420c36369237b8bb11c2d0aaf5f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: hashserv: Add `gc-mark-stream` command for batch hash markingAlexandre Marques2025-03-134-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | Implements the `gc-mark-stream` command to allow for marking equivalence entries in batch, by making use of stream mode communication to the server. The aim of this is to improve efficiency by reducing the impact of latency when marking a high volume of hash entries. Example usage of the new `gc-mark-stream` command: ``` $ cat << HASHES | \ ./bin/bitbake-hashclient --address "ws://localhost:8688/ws" gc-mark-stream "alive" unihash f37918cc02eb5a520b1aff86faacbc0a38124646 unihash af36b199320e611fbb16f1f277d3ee1d619ca58b taskhash a1117c1f5a7c9ab2f5a39cc6fe5e6152169d09c0 method oe.sstatesig.OEOuthashBasic HASHES ``` (Bitbake rev: c84715f28cd36666ea07a179d91b8c32ea0df8e7) Signed-off-by: Alexander Marques <c137.marques@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake-server/worker: Hide os.fork() deprecation warningRichard Purdie2025-03-112-0/+2
| | | | | | | | | | | | We're fairly careful in bitbake about how we handle fork() calls and believe our code to be safe. The upstream deprecation warning is problematic as it can appear in log output as a WARNING, breaking tests. It also tends to alarm users. Hide the warning for now to avoids the test failures. (Bitbake rev: c636bd629896f56e5f3d4030da3d1f130590afc6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: doc: bitbake-user-manual-metadata: document the include_all directiveAntonin Godard2025-03-111-0/+27
| | | | | | | | | | Document the include_all directive, which can be used to include multiple files present in the same location in different layers. (Bitbake rev: bd41f09c7fa67f917246a740fd4068e4588a1dcd) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: command: Fix command complete event orderingRichard Purdie2025-03-111-2/+2
| | | | | | | | | | | | The command complete event triggers the UI to start new commands. We should send this once we've cleaned up existing commands since on very slow systems, this could otherwise cause failures. There is a 30s timeout on incomming commands but slow systems have been known to hit this on poorly configured I setups. (Bitbake rev: d202298b3d989c39bc532b69c410e2e78b082a11) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Add debug for parsing being completeRichard Purdie2025-03-111-0/+1
| | | | | | | | | | We have a "parsing started" event in the cooker deamon log but we don't currently log the corresponding "parsing complete" event which is confusing. Add this so that the logs are more logical. (Bitbake rev: 1aa491c1f1211bf9faab712c321b66629fb7be66) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: doc: bitbake-user-manual-ref-variables: document BB_USE_HOME_NPMRCEric Meyers2025-03-091-0/+6
| | | | | | | | | (Bitbake rev: d5562e007c7c64e8613a118ab9a6c73ed2063263) Signed-off-by: Eric Meyers <eric.meyers@arthrex.com> Cc: Geoff Parker <geoffrey.parker@arthrex.com> Cc: Chuck Wolber <chuckwolber@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: Adding npmrc support for private registry authenticationEric Meyers2025-03-091-0/+15
| | | | | | | | | (Bitbake rev: 5fa6137b6d98544766f3152b874e67d04fafb88f) Signed-off-by: Eric Meyers <eric.meyers@arthrex.com> Cc: Geoff Parker <geoffrey.parker@arthrex.com> Cc: Chuck Wolber <chuckwolber@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: codeparser: Skipping typing when inspecting Python modulesPedro Ferreira2025-03-091-2/+10
| | | | | | | | | | | | If a custom python module is added thru BBIMPORTS and it uses typing(Any,Tuple,Union...), codeparser will fail because inspect.py raises TypeError exception if the object is a built-in module, class, or function. (Bitbake rev: 0ecfd0b8540220633e71d24cd73cc5306863ae3c) Signed-off-by: Pedro Silva Ferreira <Pedro.Silva.Ferreira@criticaltechworks.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Verify regular expression "URLs" that contain a ?Peter Kjellerstedt2025-03-071-3/+6
| | | | | | | | | | | | A regular expression "URL" in PREMIRRORS and MIRRORS may contain a ? as part of the regular expression. Make sure this does not cause problems. (Bitbake rev: 5af7fe4473cd7e75d4eb7f8b93c499bd157ff156) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Partial revert decodeurl() to not use the URI classStefan Herbrechtsmeier2025-03-071-3/+51
| | | | | | | | | | | | | | | | | | | | | | | | This partial reverts commit a5d569c94700f04b8193c6bccae5af619931b00f which changes decodeurl() to use the URI class to parse the URL instead of doing it itself. While reusing code is generally a good idea, using urllib.parse.urlparse() (which the URI class does) to parse the regular expression "URLs" that are used in PREMIRRORS and MIRRORS does not work. A regular expression URL containing https?://... would be silently ignored, while a URL using a negative lookahead such as git://(?!internal\.git\.server).*/.* would result in a cryptic error: Exception: re.error: missing ), unterminated subpattern at position 0 The problem is that urllib.parse.urlparse() treats the ? as the start of URL parameters and thus stops parsing whatever part of the URL it was parsing. Restore the old function and use it in the PREMIRRORS and MIRRORS code. (Bitbake rev: f8a7712754e6d0199a0d227fca288307b935368d) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: data_smart.py: clear expand_cache in _setvar_update_overridevarsChen Qi2025-03-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the end of this function, self.overrides is cleared, which means we'll construct a new self.overrides after this call. And a new self.overrides will give out different expand_cache, so the old expand_cache should also be cleared to avoid any wrong value. Currently, there's a problem revealed by recent recipe specific virtual provider patch. If we enable multilib and set "OVERRIDES:prepend" in local.conf, things don't work. Here's the error message: ERROR: Nothing PROVIDES 'lib32-gcc-cross-x86_64' Below are reproduce steps: 1. Add in local.conf the following lines: MACHINE ?= "qemux86-64" require conf/multilib.conf MULTILIBS ?= "multilib:lib32" DEFAULTTUNE:virtclass-multilib-lib32 ?= "core2-32" OVERRIDES:prepend = "some-override:" (Note that using :append and :remove also reproduces the issue.) 2. bitbake -n lib32-sysstat (bitbake -n core-image-minimal also reproduces the issue) The expandWithRefs calls getVar, which fills expand_cache. So when setting OVERRIDES:prepend, this will fill the expand_cache. When overridevars are updated, if we don't clear expand_cache, we'll retrieve wrong values. Previously, things happened to work because there's a call to expand PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc, which in turn expands TARGET_VENDOR. Now what we expand is PREFERRED_PROVIDER_ virtual/cross-cc, so the problem is revealed. (Bitbake rev: 842e94234c9b9faf4e902721f516071f643e49c9) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: data_smart.py: simple clean upChen Qi2025-03-061-3/+1
| | | | | | | | | | | | When var matches __setvar_regexp__, which has the value as below, __setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>:append|:prepend|:remove)(:(?P<add>[^A-Z]*))?$') the keyword will not be __doc__ or __module__ and var will always contain ":". (Bitbake rev: 0af396917fe176df7b1ed0bd7c7267507ed12e03) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: data_smart.py: remove unnecessary ? from __expand_var_regexp__Chen Qi2025-03-061-1/+1
| | | | | | | | | | The non-greedy modifier suffix ? is not necessary here because } is not in the character set [a-zA-Z0-9\-_+./~:]. (Bitbake rev: 80735719d0002c02b704a49604ddd82c461203a2) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/cooker.py: produce an error when BB_HASHSERVE_UPSTREAM ↵Alexander Kanavin2025-03-061-2/+8
| | | | | | | | | | | | | | | | cannot be used due to missing python module Previously if the websockets module was not installed bitbake would only print a warning and continue, resulting in a degraded user experience due to inability to use the configured sstate server. Let's consider that as fatal misconfiguration, so that users can address the issue properly and not wonder why builds are taking forever. (Bitbake rev: cfba2a9fca9dfa3b05ec9040fe0cb8143ac04af7) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Add an additional test case to check whether the fast ↵Stefan Koch2025-03-061-0/+12
| | | | | | | | | fetch is shallow (Bitbake rev: 16f1961e077c525ccfc12496a3deca944df89fc6) Signed-off-by: Stefan Koch <stefan-koch@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>