<?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>1654</bug_id>
          
          <creation_ts>2011-10-05 11:49:55 +0000</creation_ts>
          <short_desc>Layer tooling: Tool to combine layers</short_desc>
          <delta_ts>2017-06-15 16:03:33 +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>Other YP Layers</product>
          <component>layers</component>
          <version>unspecified</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>(Test Case Ready) Implemented feature, still one more issue to address</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>jiajun.xu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16728</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-10-05 11:49:55 +0000</bug_when>
    <thetext>A tool that can combine layers.  It must be able to combine/merge foo_ver.bb and foo_ver.bbappend files.

The output of the tool should be either a new merged layer, or one of the original layers modified with the merged results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16861</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2011-10-13 10:29:44 +0000</bug_when>
    <thetext>Mark, if I understand your description fully this tool already exists in the form of the &quot;flatten&quot; subcommand of bitbake-layers - could you take a look at that and let me know if it meets your requirements?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17069</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-11-03 08:14:42 +0000</bug_when>
    <thetext>I wasn&apos;t aware of the bitbake-layers tool had a flatten option before.  After exploring it, let me clarify the request:

The current flatten takes the bblayers.conf and simply flattens that into a single layer.  That certainly should be one of the functions.  However, I would like the ability to specify an arbitrary list of layers (preferably on the command line) and have it only flatten the components within those layers.

i.e.

bitbake-layers flatten meta-intel meta-x32 meta-intelx32

(last argument being the destination)

Also I noticed that if the directory structure of the layers was not the same, then there was no combination of the .bb and .bbappend files.  Such as:

meta-bar/recipes-devtools/baroptimizer/baroptimizer_1.0.bb

meta-foo/baroptimizer/baroptimizer_1.0.bbappend

This currently results in both of them being available.  My assumption, based on the command flatten A B C DEST, is that we are merging B and C into A, placing the result into DEST.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17989</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-01-06 02:01:06 +0000</bug_when>
    <thetext>Mark, I just attempted to reproduce the latter issue and it worked as expected - there were no bbappends in the resulting directory. Are you sure you had the layer configuration for the second layer set up such that the different path structure was recognised? Most of our layers have the appends part of BBFILES set to point to &quot;${LAYERDIR}/recipes-*/*/*.bbappend&quot; which would not pick up the example bbappend you gave.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18005</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-01-08 04:15:02 +0000</bug_when>
    <thetext>I&apos;ve sent an implementation of the feature request to be able to specify the layers to flatten, as well as a patch which warns the user if any recipes/appends in the flattened layer won&apos;t be referenced by the BBFILES paths in the flattened layer&apos;s layer.conf file.

Talking to Mark on IRC he can&apos;t shed any light on me not being able to reproduce the issue he described. Looking at the code it shouldn&apos;t have been possible to have bbappends in the flattened output layer because it explicitly skipped copying them. In any case I&apos;ll let him test the updated code with the aforementioned patches and will address any issues he finds.

Mark also thinks we should be able to automatically move recipes and their associated patches/config files to the appropriate place in the flattened layer in the case where some of the layers have a different structure. I can see this getting messy when the structure is wildly different (particularly where recipes share a directory in one layer and are split in another, which is perfectly legal as far as bitbake is concerned), but I will have a go at implementing this for M3, so this bug should be left open (or a new one split off.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18020</commentid>
    <comment_count>5</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2012-01-09 06:33:24 +0000</bug_when>
    <thetext>I think currently QA already has cases(bitbake-layers testing) to cover the feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18423</commentid>
    <comment_count>6</comment_count>
    <who name="Song Liu">song.liu</who>
    <bug_when>2012-01-30 15:17:06 +0000</bug_when>
    <thetext>M2 target for this has been completed. But still work left to automatically move recipes and their associated patches/config files to the appropriate place in the flattened layer in the case where some of the layers have a different structure, which is targeted for M3.

Moved this to M3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74228</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-06-15 15:28:42 +0000</bug_when>
    <thetext>So I think at this point we&apos;ve implemented all that we plan to on this. In any case I&apos;m not totally convinced that these days munging layers together is something we want to encourage.

If there truly is demand for this to handle all structural differences then we can open up new bugs covering the issues, but for now I&apos;m marking this one resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74237</commentid>
    <comment_count>8</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-06-15 16:03:33 +0000</bug_when>
    <thetext>I agree.. what is implemented meets all of my &apos;modern&apos; needs.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>