diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-29 12:57:40 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-09-25 05:07:47 -0700 |
| commit | 0979d14d5487928d0b4655731d932a56fd39d347 (patch) | |
| tree | eace1cf97913cd1506563945b22f98a658f0e83f /meta/classes | |
| parent | 4a64de86917872f8540ba133a8a9f87f55d93082 (diff) | |
| download | poky-0979d14d5487928d0b4655731d932a56fd39d347.tar.gz | |
buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage
We planned to drop SSTATEPOSTINSTFUNC some time ago with the introduction of
postfuncs. Finally get around to doing that which should make the buildhistory
code a little more readable.
Unfortunately ordering the buildhistory function calls after the sstate ones is
difficult without coding that into the sstate class. This patch does that to
ensure everything functions as expected until we can find a better way. This is
still likely preferable than the generic sstate postfuncs support since the function
flow is much more readable.
(From OE-Core rev: 466c505b779dec2ba790f4e6cde7fbb35037f4ef)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c9e2a8fa2f0305ef1247ec405555612326f798f8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/buildhistory.bbclass | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 08970aafea..0b1bd518fe 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
| @@ -47,11 +47,18 @@ BUILDHISTORY_PUSH_REPO ?= "" | |||
| 47 | BUILDHISTORY_TAG ?= "build" | 47 | BUILDHISTORY_TAG ?= "build" |
| 48 | BUILDHISTORY_PATH_PREFIX_STRIP ?= "" | 48 | BUILDHISTORY_PATH_PREFIX_STRIP ?= "" |
| 49 | 49 | ||
| 50 | SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory" | 50 | # We want to avoid influencing the signatures of the task so use vardepsexclude |
| 51 | # We want to avoid influencing the signatures of sstate tasks - first the function itself: | 51 | do_populate_sysroot[postfuncs] += "buildhistory_emit_sysroot" |
| 52 | sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" | 52 | do_populate_sysroot_setscene[postfuncs] += "buildhistory_emit_sysroot" |
| 53 | # then the value added to SSTATEPOSTINSTFUNCS: | 53 | do_populate_sysroot[vardepsexclude] += "buildhistory_emit_sysroot" |
| 54 | SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" | 54 | |
| 55 | do_package[postfuncs] += "buildhistory_list_pkg_files" | ||
| 56 | do_package_setscene[postfuncs] += "buildhistory_list_pkg_files" | ||
| 57 | do_package[vardepsexclude] += "buildhistory_list_pkg_files" | ||
| 58 | |||
| 59 | do_packagedata[postfuncs] += "buildhistory_emit_pkghistory" | ||
| 60 | do_packagedata_setscene[postfuncs] += "buildhistory_emit_pkghistory" | ||
| 61 | do_packagedata[vardepsexclude] += "buildhistory_emit_pkghistory" | ||
| 55 | 62 | ||
| 56 | # Similarly for our function that gets the output signatures | 63 | # Similarly for our function that gets the output signatures |
| 57 | SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" | 64 | SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" |
| @@ -91,27 +98,15 @@ buildhistory_emit_sysroot() { | |||
| 91 | # Write out metadata about this package for comparison when writing future packages | 98 | # Write out metadata about this package for comparison when writing future packages |
| 92 | # | 99 | # |
| 93 | python buildhistory_emit_pkghistory() { | 100 | python buildhistory_emit_pkghistory() { |
| 94 | if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: | ||
| 95 | bb.build.exec_func("buildhistory_emit_sysroot", d) | ||
| 96 | return 0 | ||
| 97 | |||
| 98 | if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | ||
| 99 | return 0 | ||
| 100 | |||
| 101 | if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']: | ||
| 102 | # Create files-in-<package-name>.txt files containing a list of files of each recipe's package | ||
| 103 | bb.build.exec_func("buildhistory_list_pkg_files", d) | ||
| 104 | return 0 | ||
| 105 | |||
| 106 | if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: | ||
| 107 | return 0 | ||
| 108 | |||
| 109 | import re | 101 | import re |
| 110 | import json | 102 | import json |
| 111 | import shlex | 103 | import shlex |
| 112 | import errno | 104 | import errno |
| 113 | import shutil | 105 | import shutil |
| 114 | 106 | ||
| 107 | if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | ||
| 108 | return 0 | ||
| 109 | |||
| 115 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') | 110 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') |
| 116 | oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') | 111 | oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') |
| 117 | 112 | ||
| @@ -621,6 +616,10 @@ buildhistory_list_files_no_owners() { | |||
| 621 | } | 616 | } |
| 622 | 617 | ||
| 623 | buildhistory_list_pkg_files() { | 618 | buildhistory_list_pkg_files() { |
| 619 | if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'package', '1', '0', d)}" = "0" ] ; then | ||
| 620 | return | ||
| 621 | fi | ||
| 622 | |||
| 624 | # Create individual files-in-package for each recipe's package | 623 | # Create individual files-in-package for each recipe's package |
| 625 | pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) | 624 | pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) |
| 626 | for pkgdir in $pkgdirlist; do | 625 | for pkgdir in $pkgdirlist; do |
