From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27D04C25B78 for ; Wed, 15 May 2024 09:36:41 +0000 (UTC) Subject: Re: [PATCH] buildhistory: Fix do_package race issues To: openembedded-core@lists.openembedded.org From: pmi183@gmail.com X-Originating-Location: Vila Nova de Foz Coa, Guarda, PT (213.205.68.220) X-Originating-Platform: Windows Chrome 124 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 15 May 2024 02:36:34 -0700 References: In-Reply-To: Message-ID: <22166.1715765794274311096@lists.openembedded.org> Content-Type: multipart/alternative; boundary="p8TM0rV07Oeo5blRp3hS" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 15 May 2024 09:36:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/199272 --p8TM0rV07Oeo5blRp3hS Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Alex, I did some investigation on this topic, - why is it not a hard error? That is because find command in `buildhistory_list_pkg_files` is tested ins= ide the loop for, hiding this issue and for loop is always returning 0 even= if `find` fails. >=20 > ..... > buildhistory_list_pkg_files() { > # Create individual files-in-package for each recipe's package > pkgdirlist=3D$(find ${PKGDEST}/* -maxdepth 0 -type d) >=20 > for pkgdir in pkgdirlist; do > ..... >=20 - why is it unable to find anything in packages-split/, if it executes afte= r populate_packages which places things there? As far as i could understand, there is some concurrency issue between packa= ge.bbclass and buildhistory.bbclass. Taking in consideration that `buildhis= tory_list_pkg_files` is triggered by checking if `BB_CURRENTTASK` is `packa= ge` and at the same time `PACKAGESPLITFUNCS` is triggered on `do_package`, = this leads to the issue with missing files since buildhistory bbclass might= be looking into something that wasnt yet created. In my findings, `buildhi= story_list_pkg_files` should be called in the end of `do_package` execution= where `packages-split` directory is created and populated. Is there any clear reason why we cant move `buildhistory_list_pkg_files` to= `packagedata` task since its the next task to be executed? Any suggestion or any idea how can i, from buildhistory.bbclass, determine = if `PACKAGESPLITFUNCS` was already executed? Thank you --p8TM0rV07Oeo5blRp3hS Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Alex,

I did some investigation on this topic,
=
- why is it not a hard error?

# Create individual files-in-package for each recipe's package
 pkgdirlist=3D$(find ${PKGDEST}/* -maxdepth 0 -type d)
 
for pkgdir in pkgdirlist; do
.....
 
- why is it unable to find anything in packages-split/, if it ex= ecutes after populate_packages which places things there?
As far as i could understand, there is some concurrency issue between packa= ge.bbclass and buildhistory.bbclass. Taking in consideration that `buildhis= tory_list_pkg_files` is triggered by checking if `BB_CURRENTTASK` is `packa= ge` and at the same time `PACKAGESPLITFUNCS` is triggered on `do_package`, = this leads to the issue with missing files since buildhistory bbclass might= be looking into something that wasnt yet created. In my findings, `buildhi= story_list_pkg_files` should be called in the end of `do_package` execution= where `packages-split` directory is created and populated.

Is t= here any clear reason why we cant move `buildhistory_list_pkg_files` to `pa= ckagedata` task since its the next task to be executed?

Any sugg= estion or any idea how can i, from buildhistory.bbclass, determine if `PACK= AGESPLITFUNCS` was already executed?

Thank you --p8TM0rV07Oeo5blRp3hS--