<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/command.py, branch nanbield-4.3.2</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=nanbield-4.3.2</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=nanbield-4.3.2'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2023-12-21T16:27:18+00:00</updated>
<entry>
<title>bitbake: command: Make parseRecipeFile() handle virtual recipes correctly</title>
<updated>2023-12-21T16:27:18+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>peter.kjellerstedt@axis.com</email>
</author>
<published>2023-12-06T20:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=59c56c080d41ac712aa5eeb8c1f3c62e5a5e465a'/>
<id>urn:sha1:59c56c080d41ac712aa5eeb8c1f3c62e5a5e465a</id>
<content type='text'>
Running `devtool search gcc` would result in errors like this for
virtual recipes:

  ERROR: When reparsing
  .../meta/recipes-devtools/gcc/libgcc-initial_13.2.bb:do_populate_sysroot,
  the basehash value changed from
  b1cd809ed98cef9db0fb1b17d34c4083e739c336f9d5619b89715b0294d81af5 to
  44c2f92781dc4a20e98b7bb4724e204e64b101905fa75e71241a574b725997dc. The
  metadata is not deterministic and this needs to be fixed.
  ERROR: The following commands may help:
  ERROR: $ bitbake libgcc-initial -cdo_populate_sysroot -Snone
  ERROR: Then:
  ERROR: $ bitbake libgcc-initial -cdo_populate_sysroot -Sprintdiff

The reason was the newly introduced :layer-&lt;layername&gt; override, which
is used, e.g., in meta/classes-global/insane.bbclass to add the
patch-status QA test only for the meta layer:

  ERROR_QA:append:layer-core = " patch-status"

When tinfoil parsed the recipes using the parseRecipeFile() function, it
failed to properly identify the layername for virtual recipes, which
resulted in the error above.

The correct thing to do is to make parseRecipeFile() call
bb.cache.virtualfn2realfn() to convert the virtual filename into a real
filename and virtual class.

(Bitbake rev: 4684d8886834595c3b81d97befecad69ac73545f)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: cooker: add a new function to retrieve task signatures</title>
<updated>2023-09-28T11:38:26+00:00</updated>
<author>
<name>Julien Stephan</name>
<email>jstephan@baylibre.com</email>
</author>
<published>2023-09-25T08:04:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8eeb58cf4a34546ca0c5dd6518ece317d8706c40'/>
<id>urn:sha1:8eeb58cf4a34546ca0c5dd6518ece317d8706c40</id>
<content type='text'>
adding a new command in cooker to compute and get task signatures

this commit also add the associated command and event needed to get the
signatures using tinfoil

(Bitbake rev: 05c15162de90c41dad67e37a95ec9fdb440a7864)

Signed-off-by: Julien Stephan &lt;jstephan@baylibre.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: lib: Drop inotify support and replace with mtime checks</title>
<updated>2023-09-18T10:35:05+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-09-16T17:20:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=37c31a5adc26fc947a447ca9eae0983a654d1a33'/>
<id>urn:sha1:37c31a5adc26fc947a447ca9eae0983a654d1a33</id>
<content type='text'>
With the flush in serverlog() removed and a memory resident bitbake with a
60s timeout, the following could fail in strange ways:

rm bitbake-cookerdaemon.log
bitbake-layers add-layer ../meta-virtualization/
bitbake-layers add-layer ../meta-openembedded/meta-oe/
bitbake -m

specifically that it might error adding meta-oe with an error related to meta-virt.

This clearly shows that whilst bblayers.conf was modified, bitbake was not
recognising that. This would fit with the random autobuilder issues seen when
the serverlog flush() call was removed.

The issue appears to be that you have no way to "sync()" the inotify events with
the command stream coming over the socket. There is no way to know if there are
changes in the IO queue which bitbake needs to wait for before proceeding with
the next command.

I did experiment with os.sync() and fsync on the inotify fd, however nothing
addressed the issue. Since it is extremely important we have accurate cache data,
the only realistic thing to do is to switch to stat() calls and check mtime.

For bitbake commands, this is straightforward since we can revalidate the cache
upon new connections/commands. For tinfoil this is problematic and we need to
introduce and explict command "revalidateCaches" that the code can use to force
bitbake to re-check it's cache validity. I've exposed this through tinfoil with
a new "modified_files" function.

So, this patch:

a) drops inotify support within bitbake's cooker/server and switch to using mtime
b) requires a new function call in tinfoil when metadata has been modified

(Bitbake rev: da3ec3801bdb80180b3f1ac24edb27a698415ff7)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: command: Avoid time intensive distractions for ping</title>
<updated>2023-09-02T06:46:40+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-08-30T20:39:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=3bdabde2df2cdfdf5a2fa10221abd5866cf25582'/>
<id>urn:sha1:3bdabde2df2cdfdf5a2fa10221abd5866cf25582</id>
<content type='text'>
We noticed some users were seeing very slow ping response times which
caused 'server timeout' issues. There were some function calls in runCommand
which could be slow such as the inotify callback processing.

Mark up the ping command such that it doesn't need configuration information,
it is allowed on a readonly server and specifically skip the inofity processing
too since ping would never need that.

This will hopefully resolve various ping timeout issues that were being reported.

(Bitbake rev: 0fc821a22f2b49cbd336d9658d92942c0d733be1)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: cooker: Add FILE_LAYERNAME variable containing the layername for a recipe</title>
<updated>2023-05-25T12:16:24+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-05-09T12:55:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=695998f921b691f196825e9067b6db399d691e53'/>
<id>urn:sha1:695998f921b691f196825e9067b6db399d691e53</id>
<content type='text'>
There are times when it would be useful for code to know which layer
(or collection in old bitbake terms) it is contained within.

Add support for FILE_LAYERNAME to be set by bitbake when parsing a recipe
so that it is possible to determine this. To do it, we need to pass data
from the cooker into the recipe endpoints, since only the top level cooker
information knows about the layer structure which makes the patch a bit
painful.

The idea is that this would make layer overrides possible:

OVERRIDES .= ":layer-${FILE_LAYERNAME}"

which then opens possibilities like:

WARN_QA:append:layer-core = " patch-fuzz"

as an example where OE-Core could enable specific QA tests only for that
specific layer.

(Bitbake rev: 7090a14b0035842112d073acf7f2ed1a01fdeccf)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: process/cooker/command: Fix currentAsyncCommand locking/races</title>
<updated>2023-01-11T10:58:36+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-01-09T23:17:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=165e8b563d400bf54c317659a267db85e8c34006'/>
<id>urn:sha1:165e8b563d400bf54c317659a267db85e8c34006</id>
<content type='text'>
currentAsyncCommand currently doesn't have any locking and we have
a conflict in "idle" conditions since the idle functions count needs
to be zero *and* there needs to be no active command.

Move the changes/checks of currentAsyncCommand to within the lock
and then we can add it to the condition for idle, simplifying some
of the code.

(Bitbake rev: b5215887d2f8ea3f28f1ebda721bd5b8f93ec7f3)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: cooker/command: Drop async command handler indirection via cooker</title>
<updated>2023-01-11T10:58:36+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-01-09T16:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4e4f040a73ca81f830cf90af05b75e7c06f91d8d'/>
<id>urn:sha1:4e4f040a73ca81f830cf90af05b75e7c06f91d8d</id>
<content type='text'>
Indirecting the async command handler via cooker is confusing and no
longer needed. Drop it to make things slightly clearer.

(Bitbake rev: 4a41a7d0594e6a84a67b9de70a505858aebcd84a)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: command: Ensure that failure cases call finishAsyncComand</title>
<updated>2023-01-02T17:32:57+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-01-02T16:21:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=82e77db0cec6d380766e510b9b8fdd95e2b889d0'/>
<id>urn:sha1:82e77db0cec6d380766e510b9b8fdd95e2b889d0</id>
<content type='text'>
There are a couple of failure cases that runCommands needs to better
handle, ensuring finishAsyncCommand is called. This doesn't matter if the
server is about to shut down but for memory resident bitbake and with
threading enabled, correctness is more important this could could in
theory lead to problems with the recent code changes.

By using the idleFinish class, it ensures the current async command
is terminated correctly and the various state pieces around commands
finishing are called. This also makes the code more uniform matching
the other exception handling code.

(Bitbake rev: 367a83ed46c7fbcdd06579b6cc3a6e48a89ca7fb)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Run idle commands in a separate idle thread</title>
<updated>2022-12-31T17:05:17+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-12-30T22:13:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4c57c6eeecc43d0479380144f3073e61a8b43375'/>
<id>urn:sha1:4c57c6eeecc43d0479380144f3073e61a8b43375</id>
<content type='text'>
When bitbake is off running heavier "idle" commands, it doesn't service it's
command socket which means stopping/interrupting it is hard. It also means we
can't "ping" from the UI to know if it is still alive.

For those reasons, split idle command execution into it's own thread.

The commands are generally already self containted so this is easier than
expected. We do have to be careful to only handle inotify poll() from a single
thread at a time. It also means we always have to use a thread lock when sending
events since both the idle thread and the command thread may generate log messages
(and hence events). The patch depends on  previous fixes to the builtins locking
in event.py and the heartbeat enable/disable changes as well as other locking
additions.

We use a condition to signal from the idle thread when other sections of code
can continue, thanks to Joshua Watt for the review and tweaks squashed into this
patch. We do have some sync points where we need to ensure any currently executing
commands have finished before we can start a new async command for example.

(Bitbake rev: 67dd9a5e84811df8869a82da6a37a41ee8fe94e2)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: server/process: Improve idle loop exit code</title>
<updated>2022-12-31T17:05:17+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-12-29T14:56:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c4ecfc4dc5511a23e12ed68eb140a67fd4181127'/>
<id>urn:sha1:c4ecfc4dc5511a23e12ed68eb140a67fd4181127</id>
<content type='text'>
When idle handlers want to exit, returning "False" isn't very clear
and also causes challenges with the ordering of the removing the idle
handler and marking that no async command is running.

Use a specific class to signal the exit condition allowing clearer code
and allowing the async command to be cleared after the handler has been
removed, reducing any opportunity for races.

(Bitbake rev: 102e8d0d4c5c0dd8c7ba09ad26589deec77e4308)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
