summaryrefslogtreecommitdiffstats
path: root/meta/classes/externalsrc.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/externalsrc.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/externalsrc.bbclass')
-rw-r--r--meta/classes/externalsrc.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index aedd78a03a..322734f7ac 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -63,6 +63,7 @@ python () {
63 else: 63 else:
64 d.setVar('B', '${WORKDIR}/${BPN}-${PV}') 64 d.setVar('B', '${WORKDIR}/${BPN}-${PV}')
65 65
66 bb.fetch.get_hashvalue(d)
66 local_srcuri = [] 67 local_srcuri = []
67 fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d) 68 fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d)
68 for url in fetch.urls: 69 for url in fetch.urls:
@@ -126,6 +127,9 @@ python () {
126 d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') 127 d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}')
127 d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}') 128 d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}')
128 129
130 d.appendVarFlag('do_compile', 'prefuncs', ' fetcher_hashes_dummyfunc')
131 d.appendVarFlag('do_configure', 'prefuncs', ' fetcher_hashes_dummyfunc')
132
129 # We don't want the workdir to go away 133 # We don't want the workdir to go away
130 d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN')) 134 d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
131 135