[bitbake-devel] [PATCH 7/8] bitbake: cooker: fix event notifications
Robert Yang
liezhi.yang at windriver.com
Tue Feb 6 08:46:49 UTC 2018
Hi RP,
On 02/02/2018 07:19 PM, Richard Purdie wrote:
> On Thu, 2018-02-01 at 23:15 +0800, Robert Yang wrote:
>> There are two kinds of events:
>> * directory
>> We always need handle the event since we don't know what inside the
>> directory, for example:
>> $ bitbake --server-only -T -1
>> $ bitbake -p
>> $ mkdir ${TOPDIR}/classes
>> $ cp /path/to/base.bbclass classes
>>
>> The "${TOPDIR}/classes" is a new directory, the event only reports
>> that the
>> directory is created, we don't know there is a base.bbclass unless
>> the parser
>> runs.
>>
>> * file:
>> Use bb.parse.supports() to check whether bitbake supports it or
>> not.
>>
>> And now the bbwatchedfiles is not needed anymore.
>>
>> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
>> ---
>> bitbake/lib/bb/cooker.py | 34 ++++++++++++++++++----------------
>> 1 file changed, 18 insertions(+), 16 deletions(-)
>
> I'm not sure you can do this. For example, bitbake itself doesn't
> know/care about *.patch files, however if one is referenced in a
> SRC_URI and ends up on the watch list, would this change break a patch
> file changing causing task checksums to change?
I can confirm the the following 2 things:
1) The watcher only watches __depends (and __base_depends) which only contains
files supported by bb.parse.supports(), so use bb.parse.supports() to check
it is OK (or maybe it is the best way).
2) The *.patch is not part of of __depends, but file_checksums, and they are not
watched by watchers. When a patch is updated, it would compare the saved
mtime and current mtime (in lib/bb/checksum.py), and decide whether need
recompute.
So I think that this patch is fine.
The testcase:
$ bitbake --server-only -T -1
$ bitbake quilt-native
# Update quilt-native's patch to test the rebuild:
$ echo "hello world" >>
/path/to/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch
# Build quilt-native again
$ bitbake quilt-native
NOTE: Tasks Summary: Attempted 10 tasks of which 0 didn't need to be rerun and
all succeeded.
We can see that it has been rebuilt.
// Robert
>
> Its looking like we need better tests for some of this code too :/.
>
> Cheers,
>
> Richard
>
>
More information about the bitbake-devel
mailing list