Hi Pedro, This will add the sstate-cache as a dependency of the buildhistory which can be correct if it is enabled or in use but IMO the buildhistory should also work without it, when the sstate is not in use.
Could you please test one build with: bitbake --no-setscene ... ? Jose pmi183 via lists.openembedded.org <[email protected]> escreveu (segunda, 20/05/2024 à(s) 09:10): > Hi Alex, > > I made some debug in the flow and i saw a timing issue and since there's > no reason to generate files-in-package.txt before sstate-cache operations i > moved the call to the postfunc of sstate: > > --- > meta/classes-global/sstate.bbclass | 5 +++++ > meta/classes/buildhistory.bbclass | 18 +++++++++++++++--- > meta/lib/oe/packagedata.py | 2 +- > 3 files changed, 21 insertions(+), 4 deletions(-) > > diff --git a/meta/classes-global/sstate.bbclass > b/meta/classes-global/sstate.bbclass > index 76a7b59636..7e3c3e3c4f 100644 > --- a/meta/classes-global/sstate.bbclass > +++ b/meta/classes-global/sstate.bbclass > @@ -104,6 +104,7 @@ SSTATEPOSTCREATEFUNCS = "" > SSTATEPREINSTFUNCS = "" > SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack" > SSTATEPOSTINSTFUNCS = "" > +SSTATEPOSTFUNCS = "" > EXTRA_STAGING_FIXMES ?= "HOSTTOOLS_DIR" > > # Check whether sstate exists for tasks that support sstate and are in the > @@ -805,6 +806,10 @@ python sstate_task_postfunc () { > sstate_installpkgdir(shared_state, d) > > bb.utils.remove(d.getVar("SSTATE_BUILDDIR"), recurse=True) > + > + for postfunc in (d.getVar('SSTATEPOSTFUNCS') or '').split(): > + # All hooks should run in the SSTATE_INSTDIR > + bb.build.exec_func(postfunc, d, (sstateinst,)) > } > sstate_task_postfunc[dirs] = "${WORKDIR}" > > diff --git a/meta/classes/buildhistory.bbclass > b/meta/classes/buildhistory.bbclass > index fd53e92402..054c213bf5 100644 > --- a/meta/classes/buildhistory.bbclass > +++ b/meta/classes/buildhistory.bbclass > @@ -58,6 +58,9 @@ SSTATEPOSTUNPACKFUNCS:append = " > buildhistory_emit_outputsigs" > sstate_installpkgdir[vardepsexclude] += "buildhistory_emit_outputsigs" > SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| > buildhistory_emit_outputsigs" > > +SSTATEPOSTFUNCS:append = " buildhistory_emit_filesinpackage" > +SSTATEPOSTFUNCS[vardepvalueexclude] .= "| > buildhistory_emit_filesinpackage" > + > # All items excepts those listed here will be removed from a recipe's > # build history directory by buildhistory_emit_pkghistory(). This is > # necessary because some of these items (package directories, files that > @@ -87,6 +90,16 @@ buildhistory_emit_sysroot() { > buildhistory_list_files_no_owners $BASE > ${BUILDHISTORY_DIR_PACKAGE}/sysroot > } > > +# > +# Write out files-in-package for this package > +# > +python buildhistory_emit_filesinpackage() { > + 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 > +} > + > # > # Write out metadata about this package for comparison when writing > future packages > # > @@ -99,8 +112,6 @@ python buildhistory_emit_pkghistory() { > 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']: > @@ -599,7 +610,8 @@ buildhistory_list_files_no_owners() { > > buildhistory_list_pkg_files() { > # Create individual files-in-package for each recipe's package > - for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do > + pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) > + for pkgdir in ${pkgdirlist}; do > pkgname=$(basename $pkgdir) > outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname" > outfile="$outfolder/files-in-package.txt" > diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py > index 2d1d6ddeb7..e8c503b43b 100644 > --- a/meta/lib/oe/packagedata.py > +++ b/meta/lib/oe/packagedata.py > @@ -309,7 +309,7 @@ fi > subdata_file = pkgdatadir + "/runtime/%s" % pkg > with open(subdata_file, 'w') as sf: > for var in (d.getVar('PKGDATA_VARS') or "").split(): > - val = write_if_exists(sf, pkg, var) > + write_if_exists(sf, pkg, var) > > write_if_exists(sf, pkg, 'FILERPROVIDESFLIST') > for dfile in sorted((d.getVar('FILERPROVIDESFLIST:' + pkg) or > "").split()): > -- > 2.34.1 > > > -- Best regards, José Quaresma
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#199569): https://lists.openembedded.org/g/openembedded-core/message/199569 Mute This Topic: https://lists.openembedded.org/mt/87258776/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
