From: pmi183@gmail.com
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] buildhistory: Fix do_package race issues
Date: Mon, 13 May 2024 02:47:19 -0700 [thread overview]
Message-ID: <25272.1715593639334797374@lists.openembedded.org> (raw)
In-Reply-To: <20211123135919.26315-1-richard.purdie@linuxfoundation.org>
[-- Attachment #1: Type: text/plain, Size: 3498 bytes --]
Hi Richard,
While using buildhistory, i faced an issue with files-in-package.txt missing and digging into the logs i found out:
find: ‘/home/user/src/poky-master/build/tmp/work/core2-64-poky-linux/base-passwd/3.6.3/packages-split/*’: No such file or directory
Calling `buildhistory_list_pkg_files` from do_package seems to be accessing the dir before being ready and fails.
Additionally, using `BUILDHISTORY_RESET` along with `BUILDHISTORY_PRESERVE` looks to fail to preserve files since there is nothing to handle buildhistory/old dir and ends up losing all files marked to preserve.
Thank you,
Pedro
----------------------------------------
meta/classes/buildhistory.bbclass | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index fd53e92402..4962c53cae 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -98,11 +98,6 @@ python buildhistory_emit_pkghistory() {
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
@@ -110,6 +105,7 @@ python buildhistory_emit_pkghistory() {
import json
import shlex
import errno
+ import shutil
pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE')
@@ -223,6 +219,20 @@ python buildhistory_emit_pkghistory() {
items.sort()
return ' '.join(items)
+ def copypreservedoldpkgdatafiles(pkg, preserve):
+ if os.path.exists(os.path.join(oldpkghistdir, pkg)):
+ listofobjs = os.listdir(os.path.join(oldpkghistdir, pkg))
+ for obj in listofobjs:
+ if obj not in preserve:
+ continue
+ try:
+ bb.utils.mkdirhier(os.path.join(pkghistdir, pkg))
+ shutil.copyfile(os.path.join(oldpkghistdir, pkg, obj), os.path.join(pkghistdir, pkg, obj))
+ except IOError as e:
+ bb.note("Unable to copy file. %s" % e)
+ except EnvironmentError as e:
+ bb.note("Unable to copy file. %s" % e)
+
pn = d.getVar('PN')
pe = d.getVar('PE') or "0"
pv = d.getVar('PV')
@@ -250,6 +260,11 @@ python buildhistory_emit_pkghistory() {
if not os.path.exists(pkghistdir):
bb.utils.mkdirhier(pkghistdir)
else:
+ reset = d.getVar("BUILDHISTORY_RESET")
+ if reset:
+ for pkg in packagelist:
+ copypreservedoldpkgdatafiles(pkg, preserve)
+
# Remove files for packages that no longer exist
for item in os.listdir(pkghistdir):
if item not in preserve:
@@ -327,6 +342,10 @@ python buildhistory_emit_pkghistory() {
write_pkghistory(pkginfo, d)
+ # Only executed when running task `packagedata`
+ if d.getVar('BB_CURRENTTASK') == 'packagedata':
+ bb.build.exec_func("buildhistory_list_pkg_files", d)
+
oe.qa.exit_if_errors(d)
}
--
2.34.1
[-- Attachment #2: Type: text/html, Size: 5088 bytes --]
next prev parent reply other threads:[~2024-05-13 9:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2024-05-13 9:51 ` 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25272.1715593639334797374@lists.openembedded.org \
--to=pmi183@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox