<?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>9058</bug_id>
          
          <creation_ts>2016-02-04 14:36:50 +0000</creation_ts>
          <short_desc>Bad project MACHINE setting in conf/toaster.conf causes command line builds to fail</short_desc>
          <delta_ts>2016-05-13 12:49:21 +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>Toaster</product>
          <component>toaster</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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1</target_milestone>
          <dependson>7880</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Elliot Smith">elliot.smith</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>alexandru.costinx.roman</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>brian.avery</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Alexandru Roman">alexandru.costinx.roman</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>58570</commentid>
    <comment_count>0</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-02-04 14:36:50 +0000</bug_when>
    <thetext>Because we now write our configuration out to conf/toaster.conf when we do setVariable() on the bitbake server, bad configuration in a Toaster project can cause command line builds to fail.

To reproduce:

1. Create a Toaster project and set the MACHINE variable to a bad value (e.g. &apos;xsxsxsx&apos;) via the Toaster UI.
2. Run a build for that project, e.g. &quot;zlib&quot;.
3. Go out to the command line (the same environment where you started Toaster from). Note that conf/toaster.conf now has MACHINE=&quot;xsxsxsx&quot; (bad).
4. Run a command-line build, e.g. &quot;bitbake zlib&quot;.

The build will fail with this error:

--------------------------------
ERROR:  OE-core&apos;s config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Please set a valid MACHINE in your local.conf or environment
--------------------------------

I imagine other bad settings in the Toaster project will have the same effect on command-line builds and also cause them to fail.

Note that other Toaster projects are not affected, as they rewrite the config file before their builds run (via the LocalhostBEController.triggerBuild() method).

I suggest we find a way to isolate project settings from each other, and from command-line builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58571</commentid>
    <comment_count>1</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-02-04 14:38:02 +0000</bug_when>
    <thetext>Note that command line builds currently get mixed up with project builds because of bug 9021, so in Toaster the failed command-line build will merge into the last project build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58572</commentid>
    <comment_count>2</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2016-02-04 14:41:29 +0000</bug_when>
    <thetext>Wouldn&apos;t this be fixed by bug 7880? The moment Toaster creates a separate build directory per project, we shouldn&apos;t see this kind of cross-contamination between projects... I hope :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58575</commentid>
    <comment_count>3</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-02-04 15:35:51 +0000</bug_when>
    <thetext>Providing the configuration is also stored in the project directory, it might. But the problem may be that we run one bitbake server for all projects, so there may still be configuration shared between them. Perhaps if we ran one bitbake per project, we might be OK, but that&apos;s not covered by bug 7880 and I&apos;m not sure it&apos;s even possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58831</commentid>
    <comment_count>4</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-02-10 16:17:25 +0000</bug_when>
    <thetext>NB we write to conf/local.conf, which is why failures then affect the command-line builds. In the original bug report I put conf/toaster.conf, which was incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58832</commentid>
    <comment_count>5</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-02-10 16:24:34 +0000</bug_when>
    <thetext>Actually, I was correct first time: our settings are written to conf/toaster.conf but they are picked up by command-line builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58857</commentid>
    <comment_count>6</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-02-10 21:33:32 +0000</bug_when>
    <thetext>So, a question:
Does anyone know/recall why we are feeding our toaster settings into the bitbake server via a --read conf/toasterconf.json command line argument?
---
Why I am asking:
The following works:
1) start toaster as follows:
BB_ENV_EXTRAWHITE=&quot;TOASTER_UI&quot; . ~/src/myBugs/poky/bitbake/bin/toaster start
2) put the following at the end of the conf/local/conf file:
# this will pull in the cowUI.inc when the TOASTER_UI env var is set
# for instance when the Toaster ui is running a build and will pull in 
# the cowNOUI.inc otherwise
require ${@ &apos;cowUI&apos; if d.getVar(&apos;TOASTER_UI&apos;) else &apos;cowNOUI&apos;}.inc

3) from the cli: you can run
BB_ENV_EXTRAWHITE=&quot;TOASTER_UI&quot; TOASTER_UI=1 bitbake zlib
 -- this will give you a buidl using all the toaster configuration settings
-or-
bitbake zlib
  -- this will give you a std cli build that does not use toaster variable settings but is recorded/seen by toaster
----
It seems to me that we can use this approach to separate the cli and toaster_ui type builds more cleanly and without the --read &lt;foo&gt; hiding in the background.

Hope this is kinda coherent....
-b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59329</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-02-22 12:22:43 +0000</bug_when>
    <thetext>The only reason I see to use conf/toaster.conf is to avoid updating local.conf

This bug will be automatically fixed when bug 7880 is fixed.

Brian, we can use your idea as well, but do we really need it if we&apos;re going to use unique build directory for project builds?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59336</commentid>
    <comment_count>8</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-02-22 15:31:12 +0000</bug_when>
    <thetext>No, I don&apos;t think we need it at this point. I was playing with the memres server and was just wondering about the toaster.conf approach. I agree 7880 will fix it automagically.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59795</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-03-08 16:39:21 +0000</bug_when>
    <thetext>This patchset should fix the issue: https://lists.yoctoproject.org/pipermail/toaster/2016-March/004093.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60888</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-07 08:22:03 +0000</bug_when>
    <thetext>The fix has been merged to bitbake master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a43a16b9fd471d719761354eaab81409d4b07470</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62179</commentid>
    <comment_count>11</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2016-05-13 12:49:21 +0000</bug_when>
    <thetext>Verified on master.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>