summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-23 13:14:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-24 09:55:53 +0000
commit3ddbfe0b15c7868d94539d2b26f8e1379d313333 (patch)
tree9a1ce89deded54fefa3a97b0e846b2c4f81cba9f /meta/classes/buildhistory.bbclass
parent60409917ea3e7353f5b7ee831fe4ffaff0957d94 (diff)
downloadpoky-3ddbfe0b15c7868d94539d2b26f8e1379d313333.tar.gz
buildhistory: Fix do_package race issues
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. (From OE-Core rev: b83823ce44e7531bbd2bfa62062c04147a11f724) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass12
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 64df432f13..daa96f3b63 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -91,13 +91,19 @@ buildhistory_emit_sysroot() {
91python buildhistory_emit_pkghistory() { 91python buildhistory_emit_pkghistory() {
92 if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: 92 if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']:
93 bb.build.exec_func("buildhistory_emit_sysroot", d) 93 bb.build.exec_func("buildhistory_emit_sysroot", d)
94
95 if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
96 return 0 94 return 0
97 95
98 if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): 96 if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
99 return 0 97 return 0
100 98
99 if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']:
100 # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
101 bb.build.exec_func("buildhistory_list_pkg_files", d)
102 return 0
103
104 if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
105 return 0
106
101 import re 107 import re
102 import json 108 import json
103 import shlex 109 import shlex
@@ -319,8 +325,6 @@ python buildhistory_emit_pkghistory() {
319 325
320 write_pkghistory(pkginfo, d) 326 write_pkghistory(pkginfo, d)
321 327
322 # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
323 bb.build.exec_func("buildhistory_list_pkg_files", d)
324 oe.qa.exit_if_errors(d) 328 oe.qa.exit_if_errors(d)
325} 329}
326 330