<?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>5470</bug_id>
          <alias>tinfoil2</alias>
          <creation_ts>2013-11-05 11:09:32 +0000</creation_ts>
          <short_desc>bitbake-layers cannot be used with memory resident bitbake running</short_desc>
          <delta_ts>2017-03-28 22:41:11 +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>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://wiki.yoctoproject.org/wiki/Tinfoil2</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M2</target_milestone>
          
          <blocked>7555</blocked>
    
    <blocked>8735</blocked>
    
    <blocked>10200</blocked>
    
    <blocked>10516</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreea Brandusa Proca">andreea.b.proca</reporter>
          <assigned_to name="Aníbal Limón">anibal.limon</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>anibal.limon</cc>
    
    <cc>benjamin.esquivel</cc>
    
    <cc>bluelightning</cc>
    
    <cc>kergoth</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="oscar lopez arandas">oscarx.lopez.arandas</qa_contact>
          <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>38528</commentid>
    <comment_count>0</comment_count>
    <who name="Andreea Brandusa Proca">andreea.b.proca</who>
    <bug_when>2013-11-05 11:09:32 +0000</bug_when>
    <thetext>Steps to reproduce:
1. Build an image, for example;
2. Wait until it finishes;
3. run &quot;bitbake-layers show_layers&quot;

I receive this error:
&quot;Error: Only one copy of bitbake should run against a build.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38530</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-11-05 11:40:56 +0000</bug_when>
    <thetext>This will apply to any tool that uses the tinfoil module. Unfortunately I suspect this means tinfoil will need to be reworked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51657</commentid>
    <comment_count>2</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-06-11 22:32:01 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; This will apply to any tool that uses the tinfoil module. Unfortunately I
&gt; suspect this means tinfoil will need to be reworked.

Paul, do you have a design/plan to overcome this? devtool is also affected by tinfoil. One approach would be to consider the app name (bitbake, bitbake-layers, devtool, etc) and just make the bitbake.lock check if app == bitbake.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51660</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-06-12 08:21:06 +0000</bug_when>
    <thetext>Actually I&apos;ve got more than a design - I have an initial version in a contrib branch here:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=paule/tinfoil2

It still has a lot of rough edges; at the moment I&apos;m mostly waiting for responses on an RFC regarding a proper API for tinfoil before proceeding:

http://lists.openembedded.org/pipermail/openembedded-core/2015-June/105804.html

When this first came up I did consider workarounds similar to what you are describing, but given the way bitbake works there&apos;s not currently a safe way for two servers to access the same set of cache files without a bunch more locking in place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53251</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-08-20 07:57:24 +0000</bug_when>
    <thetext>FYI work on this has stalled for now - it&apos;s turned out to be significantly more complicated than I&apos;d anticipated, not only because there were more places that needed changing, but I also discovered a number of problems with memory resident mode that need fixing at the same time in order to make this of any use.

I have sent the patches I have up to this point that are independent of the tinfoil refactoring itself, and these have now been merged. I&apos;ve rebased the paule/tinfoil2 branch on poky-contrib on top of latest master as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56864</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-11-30 09:25:49 +0000</bug_when>
    <thetext>I&apos;ve rebased the paule/tinfoil2 branch in poky-contrib on top of master and fixed it again so that at least the devtool, recipetool and bblayers oe-selftest tests pass. There&apos;s still quite a lot of cleanup and additional testing required though, and memres still needs work - e.g. I&apos;m not actually witnessing any noticeable performance gain from using it at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56875</commentid>
    <comment_count>6</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2015-11-30 17:01:00 +0000</bug_when>
    <thetext>I guess that the performance gains of using memres over regular setenv not only need to be noticeable but measurable. Leo, it would be nice to identify which performance parameters can be used to measure the improvements of using memres.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67952</commentid>
    <comment_count>7</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2016-11-03 22:18:26 +0000</bug_when>
    <thetext>Waiting on Paul to provide a rebased-to-master branch of tinfoil2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68452</commentid>
    <comment_count>8</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-11-21 09:09:16 +0000</bug_when>
    <thetext>I have rebased the branch on top of master and fixed a bunch of issues today - the basics are at least working. I&apos;ll keep poking at it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68514</commentid>
    <comment_count>9</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2016-11-22 21:02:54 +0000</bug_when>
    <thetext>assigning back to Anibal since Paul has already provided a rebased branch. Leo is pending to free up Anibal&apos;s workload to see if this can be pulled in for 2.3 M1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68517</commentid>
    <comment_count>10</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-11-22 21:23:18 +0000</bug_when>
    <thetext>Note that I am still working on this in the mean time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68656</commentid>
    <comment_count>11</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-11-28 22:23:25 +0000</bug_when>
    <thetext>OK, I have just pushed another branch with a whole bunch of issues fixed. I&apos;ve also written the following wiki page with some background and the current status:

https://wiki.yoctoproject.org/wiki/Tinfoil2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68699</commentid>
    <comment_count>12</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2016-11-29 22:59:09 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; OK, I have just pushed another branch with a whole bunch of issues fixed.
&gt; I&apos;ve also written the following wiki page with some background and the
&gt; current status:
&gt; 
&gt; https://wiki.yoctoproject.org/wiki/Tinfoil2

okay Paul, is this good now for taking over?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69642</commentid>
    <comment_count>13</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2017-01-09 22:44:41 +0000</bug_when>
    <thetext>This bug was fixed by Paul with recently tinfoil2 changes hash [1],

We need to add more extensive tenting to memres, i&apos;ll setup an AB to make periodic runs of memres and discover more bugs.


[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=358befb76ede4b111a9ee913ae2586ea30dc23b7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69838</commentid>
    <comment_count>14</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2017-01-16 20:56:40 +0000</bug_when>
    <thetext>Great Anibal, I guess it starts with a buildset that does oe-selftest from a memres environment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71825</commentid>
    <comment_count>15</comment_count>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-03-28 19:51:17 +0000</bug_when>
    <thetext>BUILD: 2.3.m3.rc1: master:415b72ffcbd26e5f3664370d8b2a9b8105fb6342
ENVIRONMENT: genericx86


Steps to reproduce:
1. Build an image: core-image-sato
2. Wait until it finishes;
3. run &quot;bitbake-layers show_layers&quot;

I receive this:
scar@oscar-ThinkPad-T540p:~/layers/build$ bitbake-layers show-layers
layer                 path                                      priority
==========================================================================
meta                  /home/oscar/layers/meta                   5
meta-poky             /home/oscar/layers/meta-poky              5
meta-yocto-bsp        /home/oscar/layers/meta-yocto-bsp         5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71828</commentid>
    <comment_count>16</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-03-28 20:16:30 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; BUILD: 2.3.m3.rc1: master:415b72ffcbd26e5f3664370d8b2a9b8105fb6342
&gt; ENVIRONMENT: genericx86
&gt; 
&gt; 
&gt; Steps to reproduce:
&gt; 1. Build an image: core-image-sato
&gt; 2. Wait until it finishes;
&gt; 3. run &quot;bitbake-layers show_layers&quot;

Your steps didn&apos;t mention how you initialised your environment, did you use oe-init-build-env or oe-init-build-env-memres?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71835</commentid>
    <comment_count>17</comment_count>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-03-28 21:37:19 +0000</bug_when>
    <thetext>Initialize environment with oe-init-build-env.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71837</commentid>
    <comment_count>18</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2017-03-28 21:50:51 +0000</bug_when>
    <thetext>(In reply to comment #17)
&gt; Initialize environment with oe-init-build-env.

Hi Oscar,

You need to use oe-init-build-env-memres because without it memory resident mode isn&apos;t activated.

Please run again your tests using memres script.

Anibal</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71838</commentid>
    <comment_count>19</comment_count>
      <attachid>3677</attachid>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-03-28 22:24:30 +0000</bug_when>
    <thetext>Created attachment 3677
bitbake-layers show-layers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71839</commentid>
    <comment_count>20</comment_count>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-03-28 22:26:45 +0000</bug_when>
    <thetext>BUILD: 2.3.m3.rc1: master:415b72ffcbd26e5f3664370d8b2a9b8105fb6342
ENVIRONMENT: genericx86


Steps to reproduce:
1. Initialize environment with oe-init-build-env-memres
2. Build an image: core-image-sato
3. Wait until it finishes;
4. I run &quot;bitbake-layers show-layers&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71841</commentid>
    <comment_count>21</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2017-03-28 22:41:11 +0000</bug_when>
    <thetext>(In reply to comment #19)
&gt; Created attachment 3677 [details]
&gt; bitbake-layers show-layers

Good, thanks!.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3677</attachid>
            <date>2017-03-28 22:24:30 +0000</date>
            <delta_ts>2017-03-28 22:24:30 +0000</delta_ts>
            <desc>bitbake-layers show-layers</desc>
            <filename>bitbake-layers  show-layers</filename>
            <type>application/octet-stream</type>
            <size>1869</size>
            <attacher name="oscar lopez arandas">oscarx.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T09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KbWV0YSAgICAgICAgICAgICAgICAgIC9ob21l
L29zY2FyL2xheWVycy9tZXRhICAgICAgICAgICAgICAgICAgIDUKbWV0YS1wb2t5ICAgICAgICAg
ICAgIC9ob21lL29zY2FyL2xheWVycy9tZXRhLXBva3kgICAgICAgICAgICAgIDUKbWV0YS15b2N0
by1ic3AgICAgICAgIC9ob21lL29zY2FyL2xheWVycy9tZXRhLXlvY3RvLWJzcCAgICAgICAgIDUK
b3NjYXJAb3NjYXItVGhpbmtQYWQtVDU0MHA6fi9sYXllcnMvYnVpbGQkIAoK
</data>

          </attachment>
      

    </bug>

</bugzilla>