All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] buildhistory: Fix do_package race issues
@ 2021-11-23 13:59 Richard Purdie
  2021-11-23 14:19 ` [OE-core] " Alexander Kanavin
  2024-05-13  9:47 ` pmi183
  0 siblings, 2 replies; 20+ messages in thread
From: Richard Purdie @ 2021-11-23 13:59 UTC (permalink / raw)
  To: openembedded-core

The buildhistory_list_pkg_files function uses data from do_package, not
do_packagedata. Usally the two are restored together but it may see
a half complete directory or other races issues depending on timing.

Rework the function so that it uses the correct task dependencies. This
should avoid races but means the data is only restored to buildhistory
if the do_package or do_package_setscene tasks are restored.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/buildhistory.bbclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 64df432f136..daa96f3b63b 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -91,13 +91,19 @@ buildhistory_emit_sysroot() {
 python buildhistory_emit_pkghistory() {
     if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']:
         bb.build.exec_func("buildhistory_emit_sysroot", d)
-
-    if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
         return 0
 
     if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
         return 0
 
+    if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']:
+        # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
+        bb.build.exec_func("buildhistory_list_pkg_files", d)
+        return 0
+
+    if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
+        return 0
+
     import re
     import json
     import shlex
@@ -319,8 +325,6 @@ python buildhistory_emit_pkghistory() {
 
         write_pkghistory(pkginfo, d)
 
-    # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
-    bb.build.exec_func("buildhistory_list_pkg_files", d)
     oe.qa.exit_if_errors(d)
 }
 
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-05-29 22:35 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-23 13:59 [PATCH] buildhistory: Fix do_package race issues Richard Purdie
2021-11-23 14:19 ` [OE-core] " Alexander Kanavin
2024-05-13  9:47 ` pmi183
2024-05-13  9:51   ` [OE-core] " Alexander Kanavin
2024-05-13 10:05     ` pmi183
2024-05-13 11:01       ` [OE-core] " Alexander Kanavin
2024-05-15  9:36         ` pmi183
2024-05-15 10:07           ` [OE-core] " Alexander Kanavin
2024-05-20  8:10             ` pmi183
2024-05-20 11:12               ` [OE-core] " Jose Quaresma
2024-05-21 10:24               ` Alexander Kanavin
2024-05-23 15:24                 ` pmi183
2024-05-23 15:24                   ` pmi183
     [not found]                   ` <Groupsio.1.30216.1716477852755796076@lists.openembedded.org>
2024-05-24  8:13                     ` [OE-core] " Alexander Kanavin
2024-05-29  8:56                       ` pmi183
2024-05-29  9:01                       ` pmi183
2024-05-29 10:22                         ` [OE-core] " Alexander Kanavin
2024-05-29 11:57                           ` pmi183
2024-05-29 12:17                             ` [OE-core] " Alexander Kanavin
2024-05-29 22:35                               ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.