<?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>14992</bug_id>
          
          <creation_ts>2022-12-21 02:40:19 +0000</creation_ts>
          <short_desc>layerindex: update.py fails to determine layer dependencies when collections contains &quot;core &lt;...&gt;&quot;</short_desc>
          <delta_ts>2023-10-07 17:56:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Layer Index</product>
          <component>Layer Index</component>
          <version>4.2</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>4.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tgamblin</cc>
          
          <qa_contact name="apoorv sangal">apoorvsangal</qa_contact>
          <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>94560</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-21 02:40:19 +0000</bug_when>
    <thetext>Many/Most layers set BBFILES_COLLECTIONS += &quot;&lt;layernick&gt;&quot;. This results in the &quot;collections&quot; variable in LayerBranch being set to &quot;core &lt;layernick&gt;&quot;. This results in a failure to determine LAYERDEPENDS [1] (or LAYERRECOMMENDS... etc), for example [2]:

ERROR: Issues found on branch master:
    meta-sourcery: Failed to add since LAYERDEPENDS is not satisfied
    meta-aarch64: Failed to add since LAYERDEPENDS is not satisfied
    meta-openstack: Failed to add since LAYERDEPENDS is not satisfied
    meta-openstack-compute-deploy: Failed to add since LAYERDEPENDS is not satisfied
    meta-openstack-controller-deploy: Failed to add since LAYERDEPENDS is not satisfied
    meta-openstack-qemu: Failed to add since LAYERDEPENDS is not satisfied
    meta-sdr: Failed to add since LAYERDEPENDS is not satisfied
    meta-cgl: Failed to add since LAYERDEPENDS is not satisfied
&lt;snip&gt;

This could probably be &quot;fixed&quot; with a proper manage.py shell script, but that is a bandage and not a robust fix.

[1] https://git.yoctoproject.org/layerindex-web/tree/layerindex/update.py#n519
[2] https://layers.openembedded.org/layerindex/updates/35825/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94561</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-21 02:50:52 +0000</bug_when>
    <thetext>As a concrete example, &apos;meta-games&apos; added &apos;meta-qt5&apos; as a layer dependency. Since &apos;meta-qt5&apos; had &quot;core qt5-layer&quot; in LayerBranch.collections, this caused a failure [1]:

WARNING: meta-games: LAYERDEPENDS: OrderedDict([(&apos;qt5-layer&apos;, [])]) LAYERRECOMMENDS: OrderedDict()
WARNING: Known collections on branch master: {(&apos;core meta-amateurradio&apos;, None), (&apos;aspnet&apos;, None), (&apos;rubygems&apos;, &apos;1&apos;), (&apos;raspberrypi&apos;, None), (&apos;phytec&apos;, &apos;2&apos;), (&apos;ivibsp&apos;, None), (&apos;rslsync-layer&apos;, None), (&apos;minnow&apos;, None), (&apos;core scanners-layer&apos;, None), (&apos;intel-iot-mw&apos;, None), (&apos;core efi-secure-boot&apos;, None), (&apos;yoctobsp&apos;, &apos;4&apos;), (&apos;core meta-arago-distro&apos;, None), (&apos;core updatehub-ti&apos;, None), (&apos;core meta-96boards&apos;, None) &lt;snip&gt;
ERROR: Issues found on branch master:
    meta-games: Failed to add since LAYERDEPENDS is not satisfied

Once the &quot;Layer Collection&quot; value of &apos;meta-qt5: master&quot; LayerBranch was manually edited in the admin interface to be only &apos;qt5-layer&apos; (&quot;core &quot; removed), the update could proceed [2].

[1] https://layers.openembedded.org/layerindex/updates/35826/
[2] https://layers.openembedded.org/layerindex/updates/35827/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94562</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2022-12-21 03:27:56 +0000</bug_when>
    <thetext>Hi Tim,

I think that it has been fixed by:

====
commit edb574ae7e076cb2f6b239ac7fc67073256bf23c
Author: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Date:   Fri Dec 16 08:42:51 2022 -0800

    utils.py: Use get_layer_var() to get BBFILE_COLLECTIONS
====

You&apos;ve already merged the patch, but the database was wrong, there should be only one BBFLIE_COLLECTIONS for each layerbranch, if you can find multiple ones in the admin UI, then I think that you can try to fix the issue by:

$ ./update.py -b master --fullreload</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94575</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-12-22 15:41:09 +0000</bug_when>
    <thetext>The YP layerindex DB still needs to be cleaned up. Robert, we need someone to take time to maintain the DB, hopefully we can get someone signed up early in the new year.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96076</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-26 21:22:02 +0000</bug_when>
    <thetext>Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96492</commentid>
    <comment_count>5</comment_count>
    <who name="Trevor Gamblin">tgamblin</who>
    <bug_when>2023-09-14 16:53:30 +0000</bug_when>
    <thetext>Moved to M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96659</commentid>
    <comment_count>6</comment_count>
      <attachid>4979</attachid>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2023-10-07 17:52:18 +0000</bug_when>
    <thetext>Created attachment 4979
fixup_collections.py

Doing a fullreload on all layers is a valid option, but a bit of a heavy hammer. Instead we can use a script to update the database.

New layers added after:
https://git.yoctoproject.org/layerindex-web/commit/layerindex?id=d8ab1beebeb5b49693b522d8618393620495bd74
did not have this problem.

The attached fixup_collections.py script is based on https://git.yoctoproject.org/layerindex-web/tree/layerindex/tools/fixup_duplicates.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96660</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2023-10-07 17:56:10 +0000</bug_when>
    <thetext>Fixed by running the fixup_collections.py script on the layers.openembedded.org instance on Sept 30, 2023. The script was copied into and run from a container used for this purpose.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4979</attachid>
            <date>2023-10-07 17:52:18 +0000</date>
            <delta_ts>2023-10-07 17:52:18 +0000</delta_ts>
            <desc>fixup_collections.py</desc>
            <filename>fixup_collections.py</filename>
            <type>text/x-python-script</type>
            <size>2289</size>
            <attacher name="Tim Orling">tim.orling</attacher>
            
              <data encoding="base64">IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoKIyBGaXggY29sbGVjdGlvbnMgdGhhdCBpbmNsdWRlICJj
b3JlICIKIwojIENvcHlyaWdodCAoQykgMjAxNyBJbnRlbCBDb3Jwb3JhdGlvbgojIEF1dGhvcjog
UGF1bCBFZ2dsZXRvbiA8cGF1bC5lZ2dsZXRvbkBsaW51eC5pbnRlbC5jb20+CiMgQ29weXJpZ2h0
IChDKSAyMDIzIEtvbnN1bGtvIEdyb3VwCiMgQXV0aG9yOiB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ICAg
b3JpZ2luYWwgPSBsYXllcmJyYW5jaC5jb2xsZWN0aW9uCiAgICAgICAgICAgICAgICAgICAgcHJp
bnQoJyAgT3JpZ2luYWw6ICVzJyAlIChvcmlnaW5hbCkpCiAgICAgICAgICAgICAgICAgICAgZml4
dXAgPSBjb2xsZWN0aW9uc1sxXQogICAgICAgICAgICAgICAgICAgIHByaW50KCcgIEZpbmFsOiAl
cycgJSAoIGZpeHVwICkpCiAgICAgICAgICAgICAgICAgICAgTGF5ZXJCcmFuY2gub2JqZWN0cy5m
aWx0ZXIoaWQ9bGF5ZXJicmFuY2guaWQpLnVwZGF0ZShjb2xsZWN0aW9uPWZpeHVwKQoKICAgICAg
ICAgICAgaWYgb3B0aW9ucy5kcnlydW46CiAgICAgICAgICAgICAgICByYWlzZSBEcnlSdW5Sb2xs
YmFja0V4Y2VwdGlvbigpCiAgICBleGNlcHQgRHJ5UnVuUm9sbGJhY2tFeGNlcHRpb246CiAgICAg
ICAgcGFzcwoKICAgIHN5cy5leGl0KDApCgoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAg
IG1haW4oKQoK
</data>

          </attachment>
      

    </bug>

</bugzilla>