summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-11 13:52:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-24 16:50:24 +0100
commit62afa02d01794376efab75623f42e7e08af08526 (patch)
treee713e2ad86aeb3daa677dc62d47b5e9d9402c957 /meta/classes-global/package.bbclass
parent871a4ac6e7e814242db4f90fc4d8ae92d72d7460 (diff)
downloadpoky-62afa02d01794376efab75623f42e7e08af08526.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/package.bbclass')
-rw-r--r--meta/classes-global/package.bbclass12
1 files changed, 11 insertions, 1 deletions
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() {
315# Package functions suitable for inclusion in PACKAGEFUNCS 315# Package functions suitable for inclusion in PACKAGEFUNCS
316# 316#
317 317
318python package_convert_pr_autoinc() { 318python package_setup_pkgv() {
319 pkgv = d.getVar("PKGV") 319 pkgv = d.getVar("PKGV")
320 # Expand SRCPV into PKGV if not present
321 srcpv = bb.fetch.get_pkgv_string(d)
322 if srcpv and "+" in pkgv:
323 d.appendVar("PKGV", srcpv)
324 pkgv = d.getVar("PKGV")
320 325
321 # Adjust pkgv as necessary... 326 # Adjust pkgv as necessary...
322 if 'AUTOINC' in pkgv: 327 if 'AUTOINC' in pkgv:
323 d.setVar("PKGV", pkgv.replace("AUTOINC", "${PRSERV_PV_AUTOINC}")) 328 d.setVar("PKGV", pkgv.replace("AUTOINC", "${PRSERV_PV_AUTOINC}"))
329}
324 330
331
332python package_convert_pr_autoinc() {
325 # Change PRSERV_PV_AUTOINC and EXTENDPRAUTO usage to special values 333 # Change PRSERV_PV_AUTOINC and EXTENDPRAUTO usage to special values
326 d.setVar('PRSERV_PV_AUTOINC', '@PRSERV_PV_AUTOINC@') 334 d.setVar('PRSERV_PV_AUTOINC', '@PRSERV_PV_AUTOINC@')
327 d.setVar('EXTENDPRAUTO', '@EXTENDPRAUTO@') 335 d.setVar('EXTENDPRAUTO', '@EXTENDPRAUTO@')
@@ -494,6 +502,7 @@ python do_package () {
494 oe.qa.handle_error("var-undefined", msg, d) 502 oe.qa.handle_error("var-undefined", msg, d)
495 return 503 return
496 504
505 bb.build.exec_func("package_setup_pkgv", d)
497 bb.build.exec_func("package_convert_pr_autoinc", d) 506 bb.build.exec_func("package_convert_pr_autoinc", d)
498 507
499 # Check for conflict between renamed packages and existing ones 508 # Check for conflict between renamed packages and existing ones
@@ -577,6 +586,7 @@ addtask do_package_setscene
577# Copy from PKGDESTWORK to tempdirectory as tempdirectory can be cleaned at both 586# Copy from PKGDESTWORK to tempdirectory as tempdirectory can be cleaned at both
578# do_package_setscene and do_packagedata_setscene leading to races 587# do_package_setscene and do_packagedata_setscene leading to races
579python do_packagedata () { 588python do_packagedata () {
589 bb.build.exec_func("package_setup_pkgv", d)
580 bb.build.exec_func("package_get_auto_pr", d) 590 bb.build.exec_func("package_get_auto_pr", d)
581 591
582 src = d.expand("${PKGDESTWORK}") 592 src = d.expand("${PKGDESTWORK}")