<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12688</bug_id>
          
          <creation_ts>2018-04-14 16:09:31 +0000</creation_ts>
          <short_desc>yocto-check-layer should allow PV changes</short_desc>
          <delta_ts>2026-04-20 21:52:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>2.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Armin Kuster">akuster</reporter>
          <assigned_to name="Denys Dmytriyenko">denis</assigned_to>
          <cc>akuster808</cc>
    
    <cc>denis</cc>
    
    <cc>paul</cc>
    
    <cc>pokylinux</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80252</commentid>
    <comment_count>0</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-04-14 16:09:31 +0000</bug_when>
    <thetext>A layer should not be penalized if it provides its own version of a recipe.

ie.   Variable PV value changed from &apos;1.1.17&apos; to &apos;1.1.5&apos;

Is there a best practices for this situation or do we need a change in the script?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80253</commentid>
    <comment_count>1</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-04-14 16:09:43 +0000</bug_when>
    <thetext>see meta-virt</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80325</commentid>
    <comment_count>2</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2018-04-19 07:43:21 +0000</bug_when>
    <thetext>Is it about *just* providing own version of a recipe?
Or is it about setting preferred version to own version?

I understand what yocto-check-layer is trying to prevent, but it should only be checking and failing the second part, not the first one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80344</commentid>
    <comment_count>3</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-04-19 11:39:10 +0000</bug_when>
    <thetext>I have an idea</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80359</commentid>
    <comment_count>4</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-04-20 08:05:36 +0000</bug_when>
    <thetext>First add:

DEFAULT_PREFERENCE = &quot;-1&quot;

to each duplicate recipe

Now depending on how many recipes there are you can do one of two ways.

In the layer.conf add

require ${@bb.utils.contains(&apos;DISTRO_FEATURES&apos;, &apos;virtualization&apos;, &apos;meta-virt-default-versions.inc&apos;, &apos;&apos;, d)

in the &quot;inc&quot; file include
+# Meta-virtuailization PREFERED_VERSION
+
+PREFERRED_VERSION_python-blinker = &quot;1.3&quot;

Or you can just use the &quot;PREFERRED_VERSION_&quot; in the above require

This scheme allowed the script to run clean. 

I sent patches to meta-virt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84033</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-05-31 17:11:37 +0000</bug_when>
    <thetext>The solution Armin added is the correct one, setting DEFAULT_PREFERENCE for new versions and then enabling them is the right way to handle this. Layers shouldn&apos;t change behavior just by adding them, they need to be enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84036</commentid>
    <comment_count>6</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-05-31 19:33:33 +0000</bug_when>
    <thetext>should this be an FAQ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84037</commentid>
    <comment_count>7</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-05-31 19:35:10 +0000</bug_when>
    <thetext>ah, no better if I add it to the wiki or doc about YP test script I need to create.

Taking issue so I remember to include.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84361</commentid>
    <comment_count>8</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-07-02 20:35:25 +0000</bug_when>
    <thetext>is 

require ${@bb.utils.contains(&apos;DISTRO_FEATURES&apos;, &apos;virtualization&apos;, &apos;meta-virt-default-versions.inc&apos;, &apos;&apos;, d)

in layer.conf 

supposed to ever expand to anything?

I did not manage to get this to work with warrior.

The expansion only seems to work from a .bb file and not from a .conf file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84367</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-07-04 08:05:28 +0000</bug_when>
    <thetext>Bruce also pointed me to this thread on the list[1]

Just added it here for reference.

[1] https://www.mail-archive.com/meta-virtualization@yoctoproject.org/msg04063.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96187</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-08-03 15:08:55 +0000</bug_when>
    <thetext>Michael, We should document this somewhere!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100016</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-10-24 15:04:01 +0000</bug_when>
    <thetext>Bulk move of 5.1 M4 to 5.2 M2 as approved by AlexB.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100194</commentid>
    <comment_count>12</comment_count>
    <who name="Antonin Godard">antonin.godard</who>
    <bug_when>2024-11-18 09:20:19 +0000</bug_when>
    <thetext>This is now documented by following commit:
https://git.yoctoproject.org/yocto-docs/commit/?id=cc3fa1b0e51377f4e03eaa1ca60c2f2ee0cd917e

I took the example from meta-virt to write some documentation about providing confs from layer.conf file, while insisting on the fact that it is better practice when conditioned by a feature.
 
Closing this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105096</commentid>
    <comment_count>13</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-15 20:43:53 +0000</bug_when>
    <thetext>I&apos;m going to reopen this, as the use case outlined in Comment #4 https://bugzilla.yoctoproject.org/show_bug.cgi?id=12688#c4 got recently broken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105112</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-04-16 14:56:24 +0000</bug_when>
    <thetext>Denys,

Where are you seeing, the problem?
Can you provide more detail or the steps to reproduce ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105119</commentid>
    <comment_count>15</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-16 19:22:42 +0000</bug_when>
    <thetext>Simplified reproduction steps:

$ cp -r openembedded-core/meta/recipes-bsp/formfactor &lt;your-layer&gt;/recipes-bsp/
$ mv &lt;your-layer&gt;/recipes-bsp/formfactor/formfactor_0.0.bb &lt;your-layer&gt;/recipes-bsp/formfactor/formfactor_1.0.bb
$ echo &apos;DEFAULT_PREFERENCE = &quot;-1&quot;&apos; &gt;&gt; &lt;your-layer&gt;/recipes-bsp/formfactor/formfactor_1.0.bb
$ yocto-check-layer &lt;your-layer&gt;

Based on the Comment #4 and Richard&apos;s confirmation in Comment #5 this was previously sufficient to pass.

Now it fails the signature check:

AssertionError: Adding layer &lt;your-layer&gt; changed signatures.
19 signatures changed, initial differences (first hash before, second after):
   formfactor:do_create_recipe_spdx: 0e6a08af4be7be22d545ce5a60c12bdcdcec2963a02c28b05753fc2a71e63131 -&gt; 621b7d1eac524fddf4741e1b9cac52168ed8e67e8f875fb8b40c853d0164a6e4
      bitbake-diffsigs --task formfactor do_create_recipe_spdx --signature 0e6a08af4be7be22d545ce5a60c12bdcdcec2963a02c28b05753fc2a71e63131 621b7d1eac524fddf4741e1b9cac52168ed8e67e8f875fb8b40c853d0164a6e4
      basehash changed from fe6b03ce7e7037b678b03b060e06bbd1b30c306a3aad86d2e6c0a5373fd407cc to 9219037157aea33fd41a490e1aa74b9ddb1040c573041ef78ff9a83753f8d918
      Variable FILE_LAYERNAME value changed from &apos;core&apos; to &apos;&lt;your-layer&gt;&apos;
      Variable PV value changed from &apos;0.0&apos; to &apos;1.0&apos;

   formfactor:do_recipe_qa: ac11a1aa4e6514527d69e9700ea8d2a8ae0079218b3e3bc25a49c274f68318a8 -&gt; f05a2943dfab19f3f5367ad48f3ac43909d130c10122796dd916599c8a5bdcc3
      bitbake-diffsigs --task formfactor do_recipe_qa --signature ac11a1aa4e6514527d69e9700ea8d2a8ae0079218b3e3bc25a49c274f68318a8 f05a2943dfab19f3f5367ad48f3ac43909d130c10122796dd916599c8a5bdcc3
      basehash changed from 68d08963da2451870d24c77018566c0ba5032e5ff332d3872ff71847d23744ed to 2d73e41565142099c1f125f29aae0f2a583f11a801d3cf6cef4b04ee7cabea1f
      Variable PV value changed from &apos;0.0&apos; to &apos;1.0&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105145</commentid>
    <comment_count>16</comment_count>
    <who name="Paul Barker">paul</who>
    <bug_when>2026-04-17 15:58:59 +0000</bug_when>
    <thetext>Hi Denys, could you retry with oe-core rolled back to:
- 13cd668c77d287bc8ae9397bb11ff53d37bae5b0, before do_create_recipe_spdx was added
- 9148a8b3ce6b2d6d192c56956a5fb0682c86b189, after the above, before check-layer fixes

That will help narrow down which change has caused the regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105147</commentid>
    <comment_count>17</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-17 17:07:11 +0000</bug_when>
    <thetext>Paul,

Rolling back to before SPDX changes removed the signature change in do_create_recipe_spdx, obviously. But do_recipe_qa still remains and fails the test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105148</commentid>
    <comment_count>18</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-17 19:54:52 +0000</bug_when>
    <thetext>So, I&apos;ve done more testing and tried to manually bisect this using my simplistic reproduction steps (OE-Core + my-layer), instead of doing it on a live setup with over a dozen of layers.

So, it would always fail the signature check for formfactor&apos;s PV with DEFAULT_PREFERENCE = &quot;-1&quot; going all the way back to yocto-2.5 (sumo), which was when this thread being discussed in 2018.

Armin&apos;s complete fix for meta-virtualization:
https://git.yoctoproject.org/meta-virtualization/commit/?h=sumo&amp;id=032ef5310419563a01baad0b1b94e4587d12f777

Those were some older versions of python modules, compared to what was in meta-python - the duplication was between meta-python and meta-virtualization. Duplicated recipes set DEFAULT_PREFERENCE = &quot;-1&quot; and corresponding PREFERRED_VERSIONs are gated.

In my case the duplication is between openembedded-core and my-layer. I set DEFAULT_PREFERENCE = &quot;-1&quot;, but don&apos;t do PREFERRED_VERSION for simplicity. I also tried decreasing PV in my-layer, instead of increasing it - doesn&apos;t help.

Interestingly, setting BBFILE_PRIORITY_my-layer lower than OE-Core, it passes! Then I compared BBFILE_PRIORITY values of meta-python and meta-virtualization in sumo - virtualization is higher. So. I&apos;m not even sure how it used to work...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105158</commentid>
    <comment_count>19</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-20 19:33:40 +0000</bug_when>
    <thetext>We&apos;ve discussed this at the TSC meeting and I&apos;ve done a few more experiments - layer priority (BBFILE_PRIORITY) here plays a major role and supersedes the DEFAULT_PREFERENCE (Richard confirmed this)

Here&apos;s what happens using my example of duplicated formfactor recipe in upstream oe-core and downstream my-layer:

* oe-core doesn&apos;t set explicit PREFERRED_VERSION for formfactor, as there&apos;s just a single version
* my-layer is expected to gate its PREFERRED_VERSION by some means, i.e. require explicit activation

In this case the signature check will pass if oe-core layer priority is higher than my-layer and will fail otherwise. Regardless of the DEFAULT_PREFERENCE in the recipe and the actual version of the recipe being higher or lower does not matter.

Now, if I explicitly set PREFERRED_VERSION in upstream oe-core to its version, while my-layer PREFERRED_VERSION is still gated, the signature check starts passing, as it seems to supersede layer priority.

I can also set default PREFERRED_VERSION in my-layer pointing to oe-core recipe version, while PREFERRED_VERSION pointing to my version is still gated - that also passes.

And lowering DEFAULT_PREFERENCE in the recipe is now useless - removed and confirmed.

So, the solution I came up with is for my-layer to have this line in the layer.conf:

PREFERRED_VERSION:formfactor = &quot;&lt;oe-core version&gt;&quot;

And in the gated .inc file that only gets included when explicitly enabled by end user with custom DISTRO_FEATURES, DISTRO or MACHINE that is specific to my-layer:

PREFERRED_VERSION:formfactor = &quot;&lt;my-layer version&gt;&quot;

The only drawback of this is it requires keeping track of oe-core version of the recipe and updating it in my-later layer.conf when it changes upstream...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105159</commentid>
    <comment_count>20</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-20 19:45:44 +0000</bug_when>
    <thetext>I&apos;ve also went back to re-test the original fix for meta-virtualization from Armin by setting all layers to use sumo branch.

Granted that back then meta-openembedded layers were not YP compatible, resulting in a lot of noise, I can still see the failure for python-blinker:

Variable PV value changed from &apos;1.4&apos; to &apos;1.3&apos;

As meta-python provides 1.4 version and no PREFERRED_VERSION, meta-virtualization provides 1.3 version and its PREFERRED_VERSION is gated by Armin&apos;s fix, and meta-virtualization has a higher layer priority vs. meta-python.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105160</commentid>
    <comment_count>21</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2026-04-20 20:40:58 +0000</bug_when>
    <thetext>Nothing in comment 19 surprises me, I think it is all working as was designed/intended, even if it is much less than ideal.

As discussed, I don&apos;t think the behaviour is ideal, however changing it is a breaking architectural change and not easy to undertake.

I don&apos;t know what happened with the meta-virtualisation change, I think the details of that are lost in time and perhaps not so relevant now. I still maintain the behaviour you&apos;re seeing is correct, even if it isn&apos;t what we&apos;d ideally like or is the most usable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105162</commentid>
    <comment_count>22</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-04-20 21:52:26 +0000</bug_when>
    <thetext>After further discussion with Richard (and the YP TSC earlier), this bug can now be closed.

DEFAULT_PREFERENCE behavior is suboptimal for this use case with its current architectural implementation.

The TSC has agreed to re-visit this in the future and consider changing this behavior, for which there&apos;s a new &quot;feature request&quot;:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=16257

For the reference, this also has been discussed all the way back in 2012 and was closed as NOTABUG with the current design/implementation:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=2964</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>