<div dir="ltr">Does SRCPV not already cover this in the majority of cases? SRCREV_FORMAT controls how the multiple revs end up in PV, and the change to PV results in rebuilding anyway. And iterating over d.keys() is inefficient, *if* you’re going to do this, operate on SRCREV, gather up the name= parameters from scm urls, and use that to drive it.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 7:10 AM Michael Ho <<a href="mailto:Michael.Ho@bmw.de">Michael.Ho@bmw.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Several fetchers support named sources that require setting a SRCREV with<br>
the source name as a suffix. These named SRCREV variables are not captured<br>
in the sstate hash calculation because they're only referenced within the<br>
bitbake fetcher function.<br>
<br>
Add a snippet to the base.bbclass anonymous python to add all named SRCREV<br>
variables to the vardeps of do_fetch to capture them in the sstate hash<br>
calculation.<br>
<br>
Testing of the bug can be shown by running the following bitbake commands<br>
with this patch set not applied:<br>
<br>
bitbake vulkan-demos | tee<br>
sed -i 's/SRCREV_gli = ".*"/SRCREV_gli = "xxx"/' \<br>
../meta/recipes-graphics/vulkan/<a href="http://vulkan-demos_git.bb" rel="noreferrer" target="_blank">vulkan-demos_git.bb</a><br>
bitbake vulkan-demos | tee;<br>
<br>
Results in no errors despite a broken SRCREV because the vulkan-demos is<br>
considered unchanged.<br>
<br>
After applying this patch the above commands instead result in a fetcher<br>
error which is correct.<br>
---<br>
meta/classes/base.bbclass | 10 ++++++++++<br>
1 file changed, 10 insertions(+)<br>
<br>
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass<br>
index 1636c6e..84a27f5 100644<br>
--- a/meta/classes/base.bbclass<br>
+++ b/meta/classes/base.bbclass<br>
@@ -638,6 +638,16 @@ python () {<br>
<br>
if needsrcrev:<br>
d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")<br>
+ # Gather all SRCREV_* references to add to the sstate hash calculation<br>
+ # This may capture SRCREVs not used but it's difficult to try to restrict it<br>
+ # to only what is needed<br>
+ for dkey in d.keys():<br>
+ if dkey.startswith("SRCREV_"):<br>
+ # This anonymous python snippet is called multiple times so we<br>
+ # need to be careful to not double up the appends here and cause<br>
+ # the base hash to mismatch the task hash<br>
+ if dkey not in (d.getVarFlag("do_fetch", "vardeps") or '').split():<br>
+ d.appendVarFlag("do_fetch", "vardeps", " {}".format(dkey))<br>
<br>
set_packagetriplet(d)<br>
<br>
-- <br>
2.7.4<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>