<?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>10344</bug_id>
          
          <creation_ts>2016-09-28 22:48:40 +0000</creation_ts>
          <short_desc>multiconfig: TMPDIR  not handled properly</short_desc>
          <delta_ts>2017-04-18 21:31:32 +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>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>2.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Juro Bystricky">juro.bystricky</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="oscar lopez arandas">oscarx.lopez.arandas</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>66707</commentid>
    <comment_count>0</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-09-28 22:48:40 +0000</bug_when>
    <thetext>I have this simple setup:

conf/local.conf: 
    BBMULTICONFIG = &quot;qemux86 qemuarm&quot;

conf/multiconfig/qemux86.conf:
    MACHINE=&quot;qemux86&quot;
    TMPDIR=&quot;${TOPDIR}/tmp-x86&quot;

conf/multiconfig/qemuarm.conf:
    MACHINE=&quot;qemuarm&quot;
    TMPDIR=&quot;${TOPDIR}/tmp-arm&quot;

After I run this command:

$ bitbake multiconfig:qemuarm:meta-toolchain multiconfig:qemux86:meta-toolchain

I get the error:

ERROR: Failed to spawn fakeroot worker to run multiconfig:qemux86:virtual:nativesdk:/data/master-zephyr/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb:do_install: [Errno 2] No such file or directory: &apos;/data/master-zephyr/poky/build-multiconfig/tmp/sysroots/x86_64-linux/usr/bin/pseudo&apos;

The program &quot;pseudo&quot; does exist in tmp-arm:
/data/master-zephyr/poky/build-multiconfig/tmp-arm/sysroots/x86_64-linux/usr/bin

and I would expect it to be spawned as fakeroot worker.


Alternatively, since &quot;pseudo&quot; also exists in tmp-x86:
/data/master-zephyr/poky/build-multiconfig/tmp-x86/sysroots/x86_64-linux/usr/bin

and the two &quot;pseudo&quot; binaries should be identical for all practical purposes,
maybe a single copy should exist and placed in the machine agnostic &quot;tmp&quot; folder. (I am not sure what is the intended behaviour)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66735</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-09-29 22:34:01 +0000</bug_when>
    <thetext>FWIW, once I manually copied &quot;pseudo&quot; to the location it is expected to be in
(/data/master-zephyr/poky/build-multiconfig/tmp/sysroots/x86_64-linux/usr/bin,  /data/master-zephyr/poky/build-multiconfig/tmp/sysroots/x86_64-linux/usr/lib/pseudo/*),

everything worked fine and both SDKs  were built in their respective tmp-xxx/deploy/sdk folders. So the TMPDIR ***almost*** works for multiconfig.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68800</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-01 22:53:16 +0000</bug_when>
    <thetext>Note the command line did not specify the &quot;default&quot; build.
Once the &quot;default&quot; build is specified, the error does not occur.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69250</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-12-20 20:44:53 +0000</bug_when>
    <thetext>I suspect the fix is:

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index da75021..638b9db 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1003,8 +1003,9 @@ class RunQueue:
             magic = &quot;decafbadbad&quot;
         if fakeroot:
             magic = magic + &quot;beef&quot;
-            fakerootcmd = self.cfgData.getVar(&quot;FAKEROOTCMD&quot;)
-            fakerootenv = (self.cfgData.getVar(&quot;FAKEROOTBASEENV&quot;) or &quot;&quot;).split()
+            mcdata = self.cooker.databuilder.mcdata[mc]
+            fakerootcmd = mcdata.getVar(&quot;FAKEROOTCMD&quot;)
+            fakerootenv = (mcdata.getVar(&quot;FAKEROOTBASEENV&quot;) or &quot;&quot;).split()
             env = os.environ.copy()
             for key, value in (var.split(&apos;=&apos;) for var in fakerootenv):
                 env[key] = value</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69256</commentid>
    <comment_count>4</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-21 01:37:21 +0000</bug_when>
    <thetext>The suggested patch did not fix the problem. I ran:

$ bitbake multiconfig:qemux86-tmp:core-image-minimal multiconfig:qemuarm-tmp:core-image-minimal core-image-minimal


This resulted in:
ERROR: Failed to spawn fakeroot worker to run multiconfig:qemux86-tmp:/data/master-multi/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.8.bb:do_install: [Errno 2] No such file or directory: &apos;/data/master-multi/poky/build-multi/tmp/sysroots/x86_64-linux/usr/bin/pseudo&apos;


If I simply only build the &quot;default&quot;, i.e.

$ bitbake core-image-minimal

I also observe an error:
ERROR: Failed to spawn fakeroot worker to run /data/master-multi/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.8.bb:do_install: [Errno 2] No such file or directory: &apos;/data/master-multi/poky/build-multi-glob-1/tmp-qemuarm/sysroots/x86_64-linux/usr/bin/pseudo&apos;

(Note that for some reason bitbake now tries to use &quot;tmp-qemuarm&quot; instead of &quot;tmp&quot;)

I added some printouts,also displaying the previous (&quot;default&quot; unpatched) value. I see this:
fakerootcmd:       &lt;...&gt;/tmp-qemuarm/sysroots/x86_64-linux/usr/bin/pseudo
fakerootcmd(prev): &lt;...&gt;/tmp/sysroots/x86_64-linux/usr/bin/pseudo

So it seems the argument &quot;mc&quot; for _start_worker has incorrect value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69264</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-12-21 14:46:39 +0000</bug_when>
    <thetext>Sadly this is only a partial fix. I reproduced the issue and have a better fix in patch review which seems to work in my local testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69279</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-12-21 17:21:39 +0000</bug_when>
    <thetext>I&apos;ve been adding fixes for things but there is only so much we can do. I fixed the issues in bitbake itself but we&apos;re now hitting class issues in the metadata, primarily due to there only being one BuildStarted event which runs against the main sysroot. My current testing has a multiconfig file like:

MACHINE = &quot;qemuarm&quot;
ERR_REPORT_DIR := &quot;${LOG_DIR}/error-report&quot;
UNINATIVE_STAGING_DIR := &quot;${STAGING_DIR}&quot;
TMPDIR = &quot;${TOPDIR}/arm

We need to expand ERR_REPORT_DIR, else if an error occurs, it can&apos;t find the base data created by the BuildStarted event, We need to set UNINATIVE_STAGING_DIR since otherwise we&apos;d have to extract uninative into each TMPDI (again from BuildStarted).

I then hit problems with gdk-pixbuf not having run in each TMPDIR and the loaders were therefore not configured which broke my core-image-sato build in gtk+3 for each multiconfig.

This issue should get resolved when we move to recipe specific sysroots so I&apos;m not planning to chase that issue any further.

Using separate TMPDIRs is likely something the user will need to do with caution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69283</commentid>
    <comment_count>7</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-21 18:43:33 +0000</bug_when>
    <thetext>Recipe specific sysroots will probably remove the main reason for separate TMPDIRs altogether, as separate TMPDIRs are needed mostly to avoid sysroot clashes. (presently the other reason would be to avoid races)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69318</commentid>
    <comment_count>8</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-12-22 15:07:37 +0000</bug_when>
    <thetext>I merged my various fixes, this now really depends on recipe specific sysroots. I suspect STAGING_DIR may need to be redefined for builds with incompatible sysrooot contents instead of TMPDIR in that case but time will tell (since the sysroots components still have to be extracted somewhere).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70051</commentid>
    <comment_count>9</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-23 20:39:52 +0000</bug_when>
    <thetext>Fixed by a series of patches by Richard, notably:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id=7d18d05d451d4a69d827f7f78e7e17b69f950269

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=5d620b7f90a6d43967b271bc165d23239b25d61c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72623</commentid>
    <comment_count>10</comment_count>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-04-18 21:31:32 +0000</bug_when>
    <thetext>multiconfig: TMPDIR  handled properly with success

Build Configuration:
BB_VERSION        = &quot;1.33.3&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.2+snapshot-20170418&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;HEAD:eff56e4f0d59b1d965a68e4f009b7f07717b7edd&quot;
 
STEP:
I have this setup:

conf/local.conf: 
    BBMULTICONFIG = &quot;qemux86 qemuarm&quot;

conf/multiconfig/qemux86.conf:
    MACHINE=&quot;qemux86&quot;
    TMPDIR=&quot;${TOPDIR}/tmp-x86&quot;

conf/multiconfig/qemuarm.conf:
    MACHINE=&quot;qemuarm&quot;
    TMPDIR=&quot;${TOPDIR}/tmp-arm&quot;

I run this command:
$ bitbake multiconfig:qemuarm:meta-toolchain multiconfig:qemux86:meta-toolchain

EXPECTED OUTCOME:
multiconfig: TMPDIR  handled properly with success

ACTUAL OUTCOME:
multiconfig: TMPDIR  handled properly with success

NOTES:
 
oscar@oscar-ThinkPad-T540p:~/qemu/build$ bitbake multiconfig:qemuarm:meta-toolchain multiconfig:qemux86:meta-toolchain
Parsing recipes: 100% |#########################################| Time: 0:00:50
Parsing of 830 .bb files complete (0 cached, 830 parsed). 3894 targets, 144 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |######################################| Time: 0:00:07
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 5980 tasks of which 4155 didn&apos;t need to be rerun and all succeeded.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>