Commit Graph

6573 Commits

Author SHA1 Message Date
Richard Purdie
b3dcb6b179 bitbake: tests/fetch: Add test for url parameter rewriting
Add a test to ensure that a parameter like protocol=git can be rewritten
to a different url and protocol.

(Bitbake rev: 69b4f9a09ff74378788cc2ec1ad58cd66b27ca59)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
a4c1325251 bitbake: fetch: Handle mirror user/password replacements correctly
Username or password replacements in URIs were being appended rather than
replaced in mirror url remapping. Fix this and add a test case.

[YOCTO #13823]

(Bitbake rev: 66ad58bb87e5158aced572be4f1d5726bc97fcce)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
34e4eebc32 bitbake: lib/bb: Fix string concatination potential performance issues
Python scales badly when concatinating strings in loops. Most of these
references aren't problematic but at least one (in data.py) is probably
a performance issue as the issue is compounded as strings become large.

The way to handle this in python is to create lists which don't reconstruct
all the objects when appending to them. We may as well fix all the references
since it stops them being copy/pasted into something problematic in the future.

This patch was based on issues highligthted by a report from AWS Codeguru.

(Bitbake rev: d654139a833127b16274dca0ccbbab7e3bb33ed0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
791d6e63be bitbake: daemonize: Avoid unclosed file warning
In theory we can leak the so file descriptor so refactor the code
to avoid that.

(Bitbake rev: dfad69d4d8c894a5e1e2686023e41552de09bf3b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
9abab49f2b bitbake: lib/bb: Clean up use of len()
(Bitbake rev: bbbc843e86639604d00d76b1949b94a78cf1d95d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
5fb6b453f6 bitbake: fetch/git: Show warning for invalid github urls
On master, tell the users they need to update their urls for github.

(Bitbake rev: 42526a402357e04794f4cb6f21ac18f562220a9b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
489fe8ff39 bitbake: fetch/git: Handle github dropping git:// support
github is dropping support for git protocol in Git urls. Add code to remap
this to https in a way that could be used in older bitbake versions.

(Bitbake rev: f05e19135b3ddee509c0cb427b3b9376bb4738d1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
2cf162f5fe bitbake: tests/fetch: Update github urls
(Bitbake rev: 07fca7e3ab696ba985b3ef86ab9031d688bf2df2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
d576d9ca3a bitbake: fetch2/git: Add a warning asking users to set a branch in git urls
There is much uncertainty around what tools and hosting providers will
do about default git branch naming in the future. To help ensure we
can handle the various scenarios, we will make branch names required in
SRC_URI. To start that process, show users a warning if it isn't set.
This may also allow us to change the default at some point in the future.

(Bitbake rev: 86a9c26828479be55865bcce72bcc7e12b93caa7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
5acc697506 bitbake: fetch2/git: Allow git fetcher to support subdir param
The git fetcher is odd in that it supports destsuffix as a parameter but not
the default documented subdir parameter. destsuffix is more limited as it can't
take absolute paths. Rework the code to correctly support subdir.

Also cleanup to use the None default .get() values and be a bit more pythonic
and use subpath as the variable name for subpath for code clarity.

We could consider dropping destsuffix as a parameter as some future point.

Also fix the tests not to pass in a subdir parameter which was never used
but now causes errors.

(Bitbake rev: 66953f06fe822e4001efabd9fc1c985ea2b03f96)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Stefan Herbrechtsmeier
e17d4895ca bitbake: fetch2: npmsw: Add support for github prefix in npm shrinkwrap version
(Bitbake rev: 1d8af6aed0a929f493d2c3e31b8d3ee3a70beb43)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-01 11:12:16 +00:00
Stefan Herbrechtsmeier
a3a26e500a bitbake: fetch2: npmsw: Add support for duplicate dependencies without url
(Bitbake rev: 9dcd9a3c671b24982aff9a994e31cb9f491471f5)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-01 11:12:16 +00:00
Chen Qi
c94075d623 bitbake: fetch2: fix downloadfilename issue with premirror
The following commit to fix [Yocto #13039] causes regression of
the behavior of PREMIRRORS.

  "bitbake: fetch2: fix premirror URI when downloadfilename defined"

Take meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.4.0.bb
as an example.
SRC_URI = "\
    http://www.freediameter.net/hg/${fd_pkgname}/archive/${PV}.tar.gz;downloadfilename=${fd_pkgname}-${PV}.tar.gz \
    ...
"
With the above commit, it now tries to fetch 1.4.0.tar.gz instead of
freeDiameter-1.4.0.tar.gz. This makes https://downloads.yoctoproject.org/mirror/sources
not work for freediameter, as it holds freeDiameter-1.4.0.tar.gz.

The commit above tries to avoid fetching from invalid url such as:
https://<some_mirror>/1.4.0.tar.gz/freeDiameter-1.4.0.tar.gz.
And its solution is to make basename to be 1.4.0.tar.gz, thus causing the
regression.

This patch fixes the above regression. For Yocto #13039, it now tries
to fetch from url: https://<some_mirror>/freeDiameter-1.4.0.tar.gz.

(Bitbake rev: 96c30007dc0b32eee2b15771daec7948bc9bfd97)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-01 11:12:16 +00:00
Chen Qi
1e5744c46d bitbake: tests/fetch.py: add test case to ensure downloadfilename is used for premirror
Add a test case test_fetch_premirror_use_downloadfilename_to_fetch to ensure
that 'downloadfilename' is used when fetching from premirror.

Although the other two previous test cases, test_fetch_premirror_specify_downloadfilename_regex_uri
and test_fetch_premirror_specify_downloadfilename_specific_uri already
implicitly contain such verification, we still need to add a very clear
case to ensure no regression.

(Bitbake rev: 20aabc3d53f69949810ecf02295725db947ffef8)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-01 11:12:16 +00:00
Chen Qi
e36765222d bitbake: tests/fetch.py: fix premirror test cases
When downloadfilename is specified, it is used to fetch from premirror.
So fix the test cases accordingly.

(Bitbake rev: 3b4d2e3b5024324058360a2a28f33c34114218d0)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-01 11:12:16 +00:00
Paul Barker
5933782d2b bitbake: doc: bitbake-user-manual: Document BB_GIT_SHALLOW and friends
Documentation is based on the commit message of bitbake rev 5ed7d85fda
and mailing list discussion.

[YOCTO #14493]

(Bitbake rev: a183322ef56c64c97aa2b72fedcdf58e29dbb3cf)

Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-27 09:49:02 +01:00
Richard Purdie
75e63f41a8 bitbake: tests/runqueue: Drop python version test decorators
Our minimum python version is 3.6 so these are now unneeded.

(Bitbake rev: 15f16bf973666807e94f3b356095f8265af0282a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-27 09:49:02 +01:00
Richard Purdie
b6b863311f bitbake: bitbake: Bump to post release verion 1.53.0
(Bitbake rev: 17d74fc64003770a94dfffa2ab102254fa52d585)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-26 14:03:45 +01:00
Richard Purdie
491b23a932 bitbake: fetch2/perforce: Fix typo
(Bitbake rev: cf421235bd6f5eb12e9193634c0e870ab035b191)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-26 13:47:24 +01:00
Richard Purdie
4359dba4fe bitbake: test/fetch: Update urls to match upstream branch name changes
(Bitbake rev: 473e2a5486bd972ad0f808db089abcb8945d3a48)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-17 22:51:59 +01:00
Richard Purdie
1028d0158a bitbake: siggen: Fix type conversion issues
The switch to using json has messed up the type handling as the code
does assume that set()s are present. Add a decoder to reconstruct
the set() objects. Also fix the change of tuples to lists for the
file checksums and fix an existing type bug where dicts insteads of
lists was used.

Drop some old siginfo format handling code which is now long since
obsolete.

(Bitbake rev: 2d704842c0928f8dbe78fd081042aa7280af96be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-17 11:57:27 +01:00
Richard Purdie
b8be48c718 bitbake: bitbake-worker: Add debug when unpickle fails
We occasionally see bitbake-worker failing and from the logs, an unpickle error
occurs. Add more debug so we can further debug this next time it fails.

[YOCTO #14595]

(Bitbake rev: fe8105cc06beca8240b76ea366a1eff5aa9c5412)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-17 11:57:27 +01:00
Richard Purdie
663a7d6574 bitbake: tests/runqueue: Ensure hashserv exits before deleting files
We've seen races where the socket may be gone but the server is still writing
out it's database. Handle that case too to avoid cleanup tracebacks.

[YOCTO #14440]

(Bitbake rev: b9e4fb843cb9d3a4d4404af093a781fab5520465)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16 17:43:00 +01:00
Jon Mason
e53c974ace bitbake: bitbake-user-manual: update sources mirror URL
The URL for the sources mirror no longer works.  Update to the new
location.

(Bitbake rev: 160feefd4af07c0b057495f19c8dd94fe243853b)

(Bitbake rev: 45ea7a937d81d68e3c1203a6e04a3f2f3cc607da)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16 17:41:59 +01:00
Ross Burton
ca8ef6bc38 bitbake: codegen: implement ast.NodeVisitor.visit_Constant
Since Python 3.8 visit_Num(), visit_Str() and so on are all deprecated
and replaced with visit_Constant.  We can't yet remove the deprecated
functions until we require 3.8, but we can implement visit_Constant to
silence the deprecation warnings.

(Bitbake rev: 4edd5767fc6d699f5262862b763b6a99ad1f1bbf)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:37:43 +01:00
Caner Altinbasak
bd5a07fbcb bitbake: fetch2: Do not attempt to verify donestamp if download is not complete
npmsw(and maybe other fetchers) may try to download same files simulatenously.

if a premirror is set, download method tries premirror location first. If file
is not found, done is set to false. In the meantime, other fetchers may download
the files required and verify_donestamp might return true.

In this scenerio, fetcher doesn't try to download again and fails. Do not
attempt to verify_donestamp if done is not set. By this way, we ensure that
fetcher attempts to do another download after premirror failure.

(Bitbake rev: 4fa25714916e84f99ecd22cb76cb5adada01e5e8)

Signed-off-by: Caner Altinbasak <cal@brightsign.biz>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:37:43 +01:00
Caner Altinbasak
8e6aaed8ff bitbake: npmsw: Avoid race condition with multiple npm fetchers
If multiple npmsw fetchers are trying to download the same npm file, one of them
can try to download the file while other is calling verify. npmsw methods gets
called without holding the lock, which causes race conditions in fetching and
verification etc. Lock the lockfile before calling proxy fetcher methods.

(Bitbake rev: fa39e6689d0f0fff772e1c81682698f4b1587b8a)

Signed-off-by: Caner Altinbasak <cal@brightsign.biz>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:37:43 +01:00
Richard Purdie
4c33a6e52b bitbake: siggen: Change file format of siginfo files to use zstd compressed json
Since OE is about to change to zstd compression of sstate, it would make it
timely to convert the siginfo files from pickle which isn't reproducible
to json which is both reproducible and also human readable. At the same time
add zstd compression. This makes the siginfo files smaller, reprodubicle
and easier to debug.

Backwards compatibility mixing the two formats hasn't been supported since
in reality if sstate changes at the same time, files will be in one format
or the new one but comparing mixed formats won't make much sense.

Since json doesn't support sets, we translate them into lists in the files
themselves. We only use sets in bitbake since it makes things easier in
the internal code, sorted lists are fine for the file format.

[YOCTO #13973]

(Bitbake rev: 22c18494c9072788e6e26eb73de70378ae5c5bf5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:37:43 +01:00
Richard Purdie
d080eaa163 bitbake: compress: Allow to operate on file descriptor
The code works fine if we pass a file descriptor in and we need to
do this from the siggen code so add that as a valid input.

(Bitbake rev: fc8d74b7de576005ecf67920501dc7e694880fda)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:37:43 +01:00
Richard Purdie
5cd1fd86f4 bitbake: bitbake-worker: Set BB_CURRENTTASK earlier
For some debugging, BB_CURRENTTASK is set too late to be useful as
it isn't present in some event handlers for example. There is no
other way to know which task is actually running so set the value
earlier.

(Bitbake rev: 7daaaaa27f55b5a458656857c6d61a51b34a62fe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:37:43 +01:00
Ross Burton
4a791f342f bitbake: fetch2: document checkstatus API
The checkstatus semantics are unconventional, so document them.

(Bitbake rev: efb949020215b580e7dc3694c377b18df2fd7e9c)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 21:31:09 +01:00
Richard Purdie
156767d3ed bitbake: bitbake: Bump to version 1.52.0
(Bitbake rev: c78ebac71ec976fdf27ea24767057882870f5c60)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11 11:06:18 +01:00
Richard Purdie
02bc1b422b bitbake: hashserv: Improve behaviour for better determinism/sstate reuse
We have a choice of policy with hashequivalence - whether to reduce
sstate duplication in the sstate feed to a minimum or have maximal
sstate reuse from the user's perspective.

The challenge is that non-matching outhashes are generated due to
determinism issues, or due to differences in host gcc version,
architecture and so on and the question is how to reconcile then.

The approach before this patch is that any new match is added and
matches can update. This has the side effect that a queried value
from the server can change due to the replacement and you may not
always get the same value from the server. With the client side
caching bitbake has, this can be suboptimal and when using the
autobuilder sstate feed, it results in poor artefact reuse.

This patch switches to the other possible behaviour, once a hash is
assigned, it doesn't change. This means some sstate artefacts may be
duplicated but dependency chains aren't invalidated which I suspect
may give better overall performance.

Update the tests to match the new behaviour.

(Bitbake rev: 20d6ac753efa364349100cdc863e5eabec8e5b78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11 11:00:06 +01:00
Joshua Watt
c7c47bb0d2 bitbake: hashserv: Fix diverging report race condition
Fixes the hashequivalence server to resolve the diverging report race
error. This error occurs when the same task(hash) is run simultaneous on
two different builders, and then the results are reported back but the
hashes diverge (e.g. have different outhashes), and one outhash is
equivalent to a hash and another is not. If taskhash was not originally
in the database, the client will fallback to using the taskhash as the
suggested unihash and the server will see reports come in like:

    taskhash: A
    unihash: A
    outhash: B

    taskhash: C
    unihash: C
    outhash: B

    taskhash: C
    unihash: C
    outhash: D

Note that the second and third reports are the same taskhash, with
diverging outhashes.

Taskhash C should be equivalent to taskhash (and unihash) A because they
share an outhash B, but the server would not do this when tasks were
reported in the order shown.

It became clear while trying to fix this that single large table to
store all reported hashes was going to make these updates difficult
since updating the unihash of all entries would be complex and time
consuming. Instead, it makes more sense to split apart the database into
two tables: One that maps taskhashes to unihashes and one that maps
outhashes to taskhashes. This should hopefully improve the parsing query
times as well since they only care about the taskhashes to unihashes
table, at the cost of more complex INNER JOIN queries on the lesser used
API.

Note this change does delete existing hash equivlance data and starts a
new database table rather than converting existing data.

(Bitbake rev: dff5a17558e2476064e85f35bad1fd65fec23600)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11 11:00:06 +01:00
Joshua Watt
ecb11a6848 bitbake: hashserv: Add tests for diverging reports
(Bitbake rev: 953c8d622c9d1bc1eb06bcaf1eaa3aa9f85d0bc2)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11 11:00:06 +01:00
Joshua Watt
cac6facc9d bitbake: async: Close sync client event loop
Prevents `ResourceWarning: unclosed event loop` warnings when using the
synchronous client and python exits

(Bitbake rev: 8b95972bc04ce52a98c7780184af15a5e95f987b)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11 11:00:06 +01:00
Jon Mason
2e78ec95be bitbake: bitbake: replace http with https for URLs
https has been the preferred way to access websites for many years now.
Change all of the URLs with a _working_ https server/certificate to use
that URL.

(Bitbake rev: da543cdaf88a387675e25d3555765f1146e4105e)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 17:04:59 +01:00
Jon Mason
fab7f4355e bitbake: bitbake:toaster:test: Update SSTATE URL
(Bitbake rev: b3c0dbddd7eb3c87e3989977d7640f09b49a460b)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:06 +01:00
Richard Purdie
a9fbdd9b24 bitbake: bitbake-worker: Handle pseudo shutdown in Ctrl+C case
If the build is interrupted, handle the shutdown of pseudo even in this
case to avoid data corruption inside docker containers.

[YOCTO #14555]

(Bitbake rev: a2a04c6fe94bc56efcff299c669a151746e35916)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:06 +01:00
Richard Purdie
0f939ecaf8 bitbake: knotty/uihelper: Show setscene task progress in summary output
With the changes to task accounting, bitbake doesn't show progress
when executing setscene tasks on the summary console output.

Change to show a progress within the setscene tasks and a progress
within the main tasks. I can't see any way to display this more easily
without confusing users.

[YOCTO #14586]

(Bitbake rev: 0244acb968eb593d2ad7bc6e52f222c2b1d39aa9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:06 +01:00
Stefan Herbrechtsmeier
fb437d6db1 bitbake: fetch2: npmsw: Add support for local tarball and link sources
(Bitbake rev: 4f983dc419a1a6f635a5d333f253d49244cec374)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:06 +01:00
Stefan Herbrechtsmeier
00f2b6d0b7 bitbake: fetch2: npm: Create config npmrc in environment instantiation
Create a configuration npmrc per npm environment to avoid repeated
creation of the same configuration file. Create the file via python to
avoid multiple npm config calls and add the ability to pass a file
path instead of a temporary file.

Deprecate the npm configs argument of the run function. The configs
should be passed to npm environment or as command specific arguments.

(Bitbake rev: 2c2df49b06a2bad7a5b8872a9998338a4660498f)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:05 +01:00
Stefan Herbrechtsmeier
d2d40e7332 bitbake: fetch2: npm: Support npm archives with missing search directory mode
Delay directory restore and set execute/search directory mode bits in
unpack to support npm archives with a missing search directory mode.

(Bitbake rev: 60cbd34d3da8f0f523281aad7eec93eec9cd4db8)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:05 +01:00
Ross Burton
c3b3d7c14f bitbake: fetch2/gitsm: remove the 'nugget' SRCREV caching
The cached revisions which are used to decide if a repository doesn't
need to be updated are misleading when used in conjunction with mirror
tarballs and can cause partial fetches to happen, resulting in unpack
errors as repositories were not fetched.

A concrete example: edk2-firmware in meta-arm is at version 202102
(ef91b0). This is built on the autobuilder so the source mirror contains
the repository as a mirror tarball.  If I build edk2-firmware 202102 the
gitsm fetcher will initially download the top-level repository and then
iterate into the submodules to also fetch those repositories, including
cmocka from cryptomilk.org.  edk2-firmware will then unpack and build
successfully.

I then update edk2-firmware to 202105 (e1999b) and build it.
Gitsm.needs_update() starts by calling Git.needs_update() which returns
False, as the mirror tarball contains this revision. It then looks at
the "nuggets" which are SRCREVs it has fetched before.  The mirror
tarball itself contains the nugget for e1999b as this has been built on
the autobuilder, so needs_update return False, no more fetching is done,
and the build proceeds to unpack.

However, as part of the 202105 upgrade the URL of the cmocka submodule
changed, and this new repository was never fetched. This means that
unpack fails as one of the required git repositories isn't available.

The nugget codepaths appear to be an attempt at optimising the fetch
process, but have demonstratable failure cases.  Just removing them
entirely solves the edk2-firmware example, and all of the fetcher test
cases still pass.

(Bitbake rev: 51212507ce3f670ace9efb691c92887d66f7aaf8)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:05 +01:00
Ross Burton
07996f492b bitbake: fetch2: clarify the command-no-found error message
If runfetchcmd() fails with bb.process.NotFoundError, the message output
is simply "Fetch command" which doesn't really explain what the problem
is.

Add "not found" to clarify what happened.

(Bitbake rev: 8de9dc02ed6a73b47f2ab10be30d1aed7954bc72)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:05 +01:00
Ross Burton
c1e7369af1 bitbake: tests/fetch: prefix the FetcherTest temporary directory
Set a prefix so the temporary directories are identifable.

(Bitbake rev: c3440b82cbe9c317f9961d61e12ea37fc9541ce0)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:05 +01:00
Ross Burton
cf9cc196dc bitbake: tests/utils: mark a regex as a raw string
Avoids a warning from Python as \s isn't a valid escape.

(Bitbake rev: be39c2e926beebe78030fbe26c6737f08f960fcb)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:05 +01:00
Richard Purdie
75b79d5c05 bitbake: data: Ensure functions are defined in a deterministic order
When writing functions into shell scripts, write then in a deterministic
order. This is unlikely to affect anything at runtime but it does change
the signatures of the generated useradd postinst scripts in OE-Core and is
a good thing to be consistent about in general.

(Bitbake rev: 8a181dc8f3c8c9c9885ea3011cb234321a296d92)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-03 00:37:27 +01:00
Richard Purdie
2446bdf59a bitbake: cooker/command: Add a dummy event for tinfoil testing
We need a command genetating an event to test through the tinfoil API. The
current test has IO load issues so add a dummy version which won't have
the IO constraints.

(Bitbake rev: a144178584394ea0700ffc2f2bfac94e8690effc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-26 16:35:00 +01:00
Richard Purdie
72e03d8a91 bitbake: siggen: Fix sorting in diff output
The diff output isn't deterministic at the moment as the sets can have differing
ordering. Sort the output so it is consistent.

(Bitbake rev: 117830c1d7ef3e53052fa326e1ca62c5c3946c45)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-26 14:37:34 +01:00