From 62afa02d01794376efab75623f42e7e08af08526 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 11 Aug 2023 13:52:59 +0100 Subject: base/package: Move source revision information from PV to PKGV Source control information being present in PV used to be a hard requirement for bitbake to operate correctly. Now that hashes are a required part of task stamps, this requirement no longer exists. This means we can defer the hash pieces to PKGV and simplify PV. Use new bitbake fetcher API to inject the source revisions directly into the hash allowing removal of some horrible code from base.bbclass and avoiding any hardcoding about how SRCREV may or may not be used. Use that API to object the string to append to PKGV and append that directly. The user visible effect of this change is that PV will no longer have revision information in it and this will now be appended to PV through PKGV when the packages are written. Since PV is used in STAMP and WORKDIR, users will see small directory naming and stamp naming changes. This will mean that sstate reuse through hash equivalence where the source revision changes but the output does not will become possible as the sstate naming will become less specific and no longer contain the revision. The SRCPV variable will no longer be needed in PV and is effectively now just a null operation. Usage can be removed over time. (From OE-Core rev: a8e7b0f932b9ea69b3a218fca18041676c65aba0) Signed-off-by: Richard Purdie --- meta/classes-global/package.bbclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'meta/classes-global/package.bbclass') diff --git a/meta/classes-global/package.bbclass b/meta/classes-global/package.bbclass index e8055a9cdc..0338a5c690 100644 --- a/meta/classes-global/package.bbclass +++ b/meta/classes-global/package.bbclass @@ -315,13 +315,21 @@ python package_get_auto_pr() { # Package functions suitable for inclusion in PACKAGEFUNCS # -python package_convert_pr_autoinc() { +python package_setup_pkgv() { pkgv = d.getVar("PKGV") + # Expand SRCPV into PKGV if not present + srcpv = bb.fetch.get_pkgv_string(d) + if srcpv and "+" in pkgv: + d.appendVar("PKGV", srcpv) + pkgv = d.getVar("PKGV") # Adjust pkgv as necessary... if 'AUTOINC' in pkgv: d.setVar("PKGV", pkgv.replace("AUTOINC", "${PRSERV_PV_AUTOINC}")) +} + +python package_convert_pr_autoinc() { # Change PRSERV_PV_AUTOINC and EXTENDPRAUTO usage to special values d.setVar('PRSERV_PV_AUTOINC', '@PRSERV_PV_AUTOINC@') d.setVar('EXTENDPRAUTO', '@EXTENDPRAUTO@') @@ -494,6 +502,7 @@ python do_package () { oe.qa.handle_error("var-undefined", msg, d) return + bb.build.exec_func("package_setup_pkgv", d) bb.build.exec_func("package_convert_pr_autoinc", d) # Check for conflict between renamed packages and existing ones @@ -577,6 +586,7 @@ addtask do_package_setscene # Copy from PKGDESTWORK to tempdirectory as tempdirectory can be cleaned at both # do_package_setscene and do_packagedata_setscene leading to races python do_packagedata () { + bb.build.exec_func("package_setup_pkgv", d) bb.build.exec_func("package_get_auto_pr", d) src = d.expand("${PKGDESTWORK}") -- cgit v1.2.3-54-g00ecf