<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Martin,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">It seems a little tricky though to need to know about the sstate hashing in order to use named<br>
source revisions and it could be a bit confusing that using a normal SRCREV doesn’t require any<br>
extra effort but named SRCREVs require additional lines of metadata. As you can see in the<br>
commit message of my patches, the vulkan-demos recipe in poky also has this issue so it might<br>
be quite easy to forget.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks for the feedback. If the patch idea isn’t good, let me know if you think I should instead<br>
post a patch for the documentation to try to more explicitly note the need for the additional vardeps<br>
statements when using named SRCREVs.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
<p class="MsoNormal">Michael<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">--&nbsp;<o:p></o:p></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333">BMW Car IT GmbH</span></b><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">Michael Ho</span><br>
Spezialist Entwicklung – Build and Release Engineering<br>
<span style="background:white">Lise-Meitner-Straße 14</span><br>
<span style="background:white">89081 Ulm</span><br>
<br>
<span style="background:white">Tel.:&nbsp;­&#43;49-731-37804-071<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white">Mobil: &#43;49-152-54980-471</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">Fax: &#43;49-731-37804-001</span><br>
<span style="background:white">Mail:&nbsp;</span></span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif"><a href="mailto:michael.ho@bmw-carit.de"><span style="color:#0563C1">michael.ho@bmw-carit.de</span></a><span style="color:#333333;background:white">&nbsp;</span><span style="color:#333333"><br>
<span style="background:white">Web:&nbsp;</span></span></span><a href="http://www.bmw-carit.de/"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#326CA6">http://www.bmw-carit.de</span></a><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">-------------------------------------------------------------------------</span><br>
<span style="background:white">BMW Car IT GmbH</span><br>
<span style="background:white">Geschäftsführer:&nbsp;Kai-Uwe Balszuweit und</span></span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#999999">&nbsp;</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white">Christian
 Salzmann</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">Sitz und Registergericht: München HRB 134810</span><br>
<span style="background:white">-------------------------------------------------------------------------</span></span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Martin Jansa &lt;martin.jansa@gmail.com&gt;<br>
<b>Date: </b>Monday, 27 May 2019 at 5:44 pm<br>
<b>To: </b>&quot;Ho Michael, JC-3UL&quot; &lt;Michael.Ho@bmw.de&gt;<br>
<b>Cc: </b>Chris Larson &lt;kergoth@gmail.com&gt;, Patches and discussions about the oe-core layer &lt;openembedded-core@lists.openembedded.org&gt;<br>
<b>Subject: </b>Re: [OE-core] [PATCH] base.bbclass: add named SRCREVs to the sstate hash<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">In those recipes which don't include SRCPV in PV (for whatever reason) we usually add them explicitly with:
<o:p></o:p></p>
<div>
<p class="MsoNormal">do_fetch[vardeps] &#43;= &quot;SRCREV_common&quot;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">it's not ideal as people sometimes forget about this. Good practice is to add this next to the SRCREV_FORMAT (if you set one, to clearly show which revs are and aren't included).<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, May 27, 2019 at 5:37 PM &lt;<a href="mailto:Michael.Ho@bmw.de">Michael.Ho@bmw.de</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Christopher,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thank you for the feedback. Since SRCPV is not always enforced (correct me if I’m wrong), it seems easy to trip over this bug when just following the documentation on multiple named
 source uri’s (also if you purposely don’t want to include the secondary source revisions in the package version). I’ll give it another shot to make it more efficient. If it’s not expected to be an encounterable bug case you can ignore the patch.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Kind regards,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Michael<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">--&nbsp;<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333">BMW Car IT GmbH</span></b><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">Michael Ho</span><br>
Spezialist Entwicklung – Build and Release Engineering<br>
<span style="background:white">Lise-Meitner-Straße 14</span><br>
<span style="background:white">89081 Ulm</span><br>
<br>
<span style="background:white">Tel.:&nbsp;­&#43;49-731-37804-071</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white">Mobil: &#43;49-152-54980-471</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">Fax: &#43;49-731-37804-001</span><br>
<span style="background:white">Mail:&nbsp;</span></span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif"><a href="mailto:michael.ho@bmw-carit.de" target="_blank"><span style="color:#0563C1">michael.ho@bmw-carit.de</span></a><span style="color:#333333;background:white">&nbsp;</span><span style="color:#333333"><br>
<span style="background:white">Web:&nbsp;</span></span></span><a href="http://www.bmw-carit.de/" target="_blank"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#326CA6">http://www.bmw-carit.de</span></a><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">-------------------------------------------------------------------------</span><br>
<span style="background:white">BMW Car IT GmbH</span><br>
<span style="background:white">Geschäftsführer:&nbsp;Kai-Uwe Balszuweit und</span></span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#999999">&nbsp;</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white">Christian
 Salzmann</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">Sitz und Registergericht: München HRB 134810</span><br>
<span style="background:white">-------------------------------------------------------------------------</span></span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Christopher Larson &lt;<a href="mailto:kergoth@gmail.com" target="_blank">kergoth@gmail.com</a>&gt;<br>
<b>Date: </b>Wednesday, 8 May 2019 at 5:17 pm<br>
<b>To: </b>&quot;Ho Michael, JC-3UL&quot; &lt;<a href="mailto:Michael.Ho@bmw.de" target="_blank">Michael.Ho@bmw.de</a>&gt;<br>
<b>Cc: </b>Patches and discussions about the oe-core layer &lt;<a href="mailto:openembedded-core@lists.openembedded.org" target="_blank">openembedded-core@lists.openembedded.org</a>&gt;<br>
<b>Subject: </b>Re: [OE-core] [PATCH] base.bbclass: add named SRCREVs to the sstate hash</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Wed, May 8, 2019 at 7:10 AM Michael Ho &lt;<a href="mailto:Michael.Ho@bmw.de" target="_blank">Michael.Ho@bmw.de</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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 = &quot;.*&quot;/SRCREV_gli = &quot;xxx&quot;/' \<br>
&nbsp; ../meta/recipes-graphics/vulkan/<a href="http://vulkan-demos_git.bb" 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>
&nbsp;meta/classes/base.bbclass | 10 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;<br>
&nbsp;1 file changed, 10 insertions(&#43;)<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>
&#43;&#43;&#43; b/meta/classes/base.bbclass<br>
@@ -638,6 &#43;638,16 @@ python () {<br>
<br>
&nbsp; &nbsp; &nbsp;if needsrcrev:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;d.setVar(&quot;SRCPV&quot;, &quot;${@bb.fetch2.get_srcrev(d)}&quot;)<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; # Gather all SRCREV_* references to add to the sstate hash calculation<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; # This may capture SRCREVs not used but it's difficult to try to restrict it<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; # to only what is needed<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; for dkey in d.keys():<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if dkey.startswith(&quot;SRCREV_&quot;):<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # This anonymous python snippet is called multiple times so we<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # need to be careful to not double up the appends here and cause<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # the base hash to mismatch the task hash<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if dkey not in (d.getVarFlag(&quot;do_fetch&quot;, &quot;vardeps&quot;) or '').split():<br>
&#43;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.appendVarFlag(&quot;do_fetch&quot;, &quot;vardeps&quot;, &quot; {}&quot;.format(dkey))<br>
<br>
&nbsp; &nbsp; &nbsp;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" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">--
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Christopher Larson<br>
kergoth at gmail dot com<br>
Founder - BitBake, OpenEmbedded, OpenZaurus<br>
Senior Software Engineer, Mentor Graphics<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal">-- <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" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>