<?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>3271</bug_id>
          
          <creation_ts>2012-10-10 16:29:10 +0000</creation_ts>
          <short_desc>Better error message when bitbake is run from the &apos;wrong&apos; directory</short_desc>
          <delta_ts>2013-10-02 12:59:51 +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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Evadeflow">evadeflow</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>corneliux.stoicescu</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>26494</commentid>
    <comment_count>0</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-10 16:29:10 +0000</bug_when>
    <thetext>I was just trying to follow along with Patrick Turley&apos;s &apos;Hello World&apos; example (see https://lists.yoctoproject.org/pipermail/yocto/2012-October/012193.html) and I accidentally forgot to switch to the build directory before invoking bitbake.  The error I got (with bitbake master) was:

&gt; % ../bitbake/bin/bitbake a 
&gt; The BBPATH variable is not set
&gt; DEBUG: Removed the following variables from the environment: http_proxy, CVS_RSH, LANG, SHLVL, LD_LIBRARY_PATH, EDITOR, SUDO_USER, USERNAME, PROMPT, PYTHONPATH, SUDO_UID, RPROMPT, _, SUDO_COMMAND, SUDO_GID, OLDPWD, MAIL
DEBUG: UI &apos;knotty&apos; does not require extra cache!

A simple oversight like this must happen a dozen times daily here on Planet Earth. Once you&apos;ve become accustomed to bitbake&apos;s quirks, I&apos;m sure this isn&apos;t the slightest bit confusing; but to a novitiate like myself, it almost feels like I&apos;m being hazed. Don&apos;t Haze Me, Bro&apos;! :-}

There are probably valid reasons that bitbake can&apos;t detect with 100% accuracy that the user has simply forgotten to change to the correct directory. But it should be able to make a good guess and offer corrective advice. If there&apos;s a directory named &apos;build*&apos; in the current directory with a &apos;conf&apos; sub-folder, how about saying:

&gt; The BBPATH variable is not set
&gt; (Perhaps you intended to run bitbake from /home/evadeflow/projects/foo/build?)

Even for out-of-source builds, there&apos;s got to be some way of emitting a more helpful error message. BBPATH is not set? Heck, NOTHING is set. Can&apos;t bitbake detect this and say:

&gt; The BBPATH variable is not set
&gt; (Did you invoke bitbake from the wrong directory?)

Oh, yes--yes, I did. Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26521</commentid>
    <comment_count>1</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2012-10-11 14:46:22 +0000</bug_when>
    <thetext>Hello.

I just ran bitbake from the poky directory and I got: 
&quot;
Unable to find conf/bblayers.conf
BitBake must be run from within your build diectory: /home/cornel/Yocto/poky/build
&quot;

Please give us the exact steps to reproduce this.

Thank you
Cornel.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26533</commentid>
    <comment_count>2</comment_count>
      <attachid>885</attachid>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-11 16:08:04 +0000</bug_when>
    <thetext>Created attachment 885
Bitbake &apos;Hello World!&apos; example

This example is the one that caused me to file the bug. But I don&apos;t think it&apos;s needed to reproduce the behavior:

&gt; poky|master|% pwd
&gt; /home/evadeflow/projects/poky
&gt; poky|master|% echo &quot;Note: I have not sourced oe-init-build-env&quot;
&gt; Note: I have not sourced oe-init-build-env
&gt; poky|master|% echo $PATH
&gt; /home/evadeflow/bin:/home/evadeflow/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
&gt; poky|master|% ./bitbake/bin/bitbake foo
&gt; The BBPATH variable is not set
&gt; DEBUG: Removed the following variables from the environment: http_proxy, CVS_RSH, LANG, SHLVL, LD_LIBRARY_PATH, EDITOR, SUDO_USER, USERNAME, PROMPT, PYTHONPATH, SUDO_UID, RPROMPT, _, SUDO_COMMAND, SUDO_GID, OLDPWD, MAIL
&gt; DEBUG: UI &apos;knotty&apos; does not require extra cache!

Not a big deal, I just think that error message could be better. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26553</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-10-12 13:43:22 +0000</bug_when>
    <thetext>You should not be running bin/bitbake but instead scripts/bitbake, which is a wrapper that ensures everything is set up correctly. bitbake as we use it in OE-Core/Poky is really intended be run from the wrapper script so I don&apos;t think we really support doing otherwise (until the wrapper script goes away, which it will do at some point in the future).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26560</commentid>
    <comment_count>4</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-12 16:00:16 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; You should not be running bin/bitbake but instead scripts/bitbake...

The message is a lot clearer in this case:

&gt; bitbake_hello% ../poky/scripts/bitbake foo
&gt; Unable to find conf/bblayers.conf
&gt; BitBake must be run from within your build directory

Since I was following along with someone&apos;s &apos;Hello, World&apos; example, I
just did what it recommended. If the wrapper script can emit such a
lucid error message, why can&apos;t bitbake/bin say something more helpful
than:

&gt; The BBPATH variable is not set

I completely understand that this is an extremely low priority item.
You can assign this bug to me if you want. It would be a good
introduction for me, and maybe I&apos;ll discover along the way that
improving the error output is actually quite involved. I&apos;m just trying
to be as critical of bitbake&apos;s user experience as I am about my own
company&apos;s products. A bad first impression can turn off would-be users
who are just &apos;doing a drive-by&apos;, and mind share is everything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26561</commentid>
    <comment_count>5</comment_count>
      <attachid>887</attachid>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2012-10-12 16:40:03 +0000</bug_when>
    <thetext>Created attachment 887
Fix error msg when bblayers.conf not found

Humbly submit this is small improvement...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34208</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-06-28 09:35:47 +0000</bug_when>
    <thetext>Patch merged to master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=624160af6e5429c9f08b201bc6599dc8dcb62c3f sorry about the delay in doing so, didn&apos;t notice there was a patch here.

Incidentally the wrapper script is now gone so this is a bigger issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37478</commentid>
    <comment_count>7</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-10-02 12:59:51 +0000</bug_when>
    <thetext>Verified in:
poky master:2f64fae60b3f61a2c45dc9e5314d2d16b1e64605

Please look at this bug for tips on using bitbake from any directory: bug 5063</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>885</attachid>
            <date>2012-10-11 16:08:04 +0000</date>
            <delta_ts>2012-10-11 16:08:04 +0000</delta_ts>
            <desc>Bitbake &apos;Hello World!&apos; example</desc>
            <filename>bitbake_hello.tar.bz2</filename>
            <type>application/x-bzip2</type>
            <size>667</size>
            <attacher name="Evadeflow">evadeflow</attacher>
            
              <data encoding="base64">QlpoOTFBWSZTWeNoS2IAAoL/7c6QAEB0/f/ev+/dpf9/36oAAQCAAIAAAIAAgAhAAlxbBIBCSZAZ
A0GJkAMgaGQyMgAAaAAaKJ6NGpiaaaT1BiDDQjIyaGho9IM1MBNNGhxkyaNAaNMRkaGIYE0aYgxG
gwgAMEigmkCnlPaCmnlHqaGjQNA00M1GCD1GgNDynQkdHKsZ72GVGcWwKJDvNppO0kgCebQ4Z+w3
ohoRcFgEiNJldcG4Ox1wg4tQkkWxIxgmhKAkQGkZel8zWbp95HCNSZDRbSLaS/CQ0F23b2QsDAcI
uIC6GJ9EEQYKFzKR/FMXJI49D5qBtYqvAhPcAspIrhjrMYPicCjyoE99CX0DUbOB106MC/YIHG4Q
ZBdCAcRSmTaddyn7qUUebyM8IIAycmnTp45cm7z8+6CR6uAFt317GcEd/iqmFaRZUNE3KJpjWObK
VFSRK1jpKEyI4UmKLRKlRVC5GVFBgTE6SlIcERg3kFWKARQUE1FVxVVHVXGkCQOVxDK0x1k4khTk
Q3HbZy8mmQ3yxhma1PvWmHPxcJtBwhrPciEavDFAy0OUjA81fROGtWMJdIwh5+qS4UkgGBISWshS
t9xCgohMnHNdSESqhWAZOiwZvQk0YimABaSasyInHnm4sSJSuwBll24b/pBYEjxZOi90/r2oX0BN
wWdtDiooVO6W3CT/r129bDZshTHt1pctk4l1NEb6CZTj+X85tWtgtzXTeoCwgVnU1AX89gKXX2AY
Z40LRb880LFUrVNlTSuoWVC1XL1yFTAmhWV4S6BASNWugkU2rWbBHevJGBKsw9tI/yRLHK/EsrmM
LmRItiRIFivoW1ViygbEi7angugX9GwCzQBUCX/F3JFOFCQ42hLYgA==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>887</attachid>
            <date>2012-10-12 16:40:03 +0000</date>
            <delta_ts>2012-10-12 16:40:03 +0000</delta_ts>
            <desc>Fix error msg when bblayers.conf not found</desc>
            <filename>0001-Fix-error-msg-when-bblayers.conf-not-found.patch</filename>
            <type>text/plain</type>
            <size>1083</size>
            <attacher name="Evadeflow">evadeflow</attacher>
            
              <data encoding="base64">RnJvbSA3ODUzNzc5NjFhNTM3MzFiYWMzYTI0NTIxM2RiODRmZTY1NTFiZTM4IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBFdmFkZSBGbG93IDxldmFkZWZsb3dAZ21haWwuY29tPgpEYXRl
OiBGcmksIDEyIE9jdCAyMDEyIDEyOjM3OjUzIC0wNDAwClN1YmplY3Q6IFtQQVRDSF0gRml4IGVy
cm9yIG1zZyB3aGVuIGJibGF5ZXJzLmNvbmYgbm90IGZvdW5kCgpTaWduZWQtb2ZmLWJ5OiBFdmFk
ZSBGbG93IDxldmFkZWZsb3dAZ21haWwuY29tPgotLS0KIGxpYi9iYi9jb29rZXIucHkgfCAgICA3
ICsrKysrKy0KIDEgZmlsZSBjaGFuZ2VkLCA2IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkK
CmRpZmYgLS1naXQgYS9saWIvYmIvY29va2VyLnB5IGIvbGliL2JiL2Nvb2tlci5weQppbmRleCA3
Y2ExZmZkLi42NTllYTgxIDEwMDY0NAotLS0gYS9saWIvYmIvY29va2VyLnB5CisrKyBiL2xpYi9i
Yi9jb29rZXIucHkKQEAgLTg1OCw3ICs4NTgsMTIgQEAgY2xhc3MgQkJDb29rZXI6CiAgICAgICAg
ICAgICBkYXRhLmRlbFZhcignTEFZRVJESVInKQogCiAgICAgICAgIGlmIG5vdCBkYXRhLmdldFZh
cigiQkJQQVRIIiwgVHJ1ZSk6Ci0gICAgICAgICAgICByYWlzZSBTeXN0ZW1FeGl0KCJUaGUgQkJQ
QVRIIHZhcmlhYmxlIGlzIG5vdCBzZXQiKQorICAgICAgICAgICAgbXNnID0gIlRoZSBCQlBBVEgg
dmFyaWFibGUgaXMgbm90IHNldCIKKyAgICAgICAgICAgIGlmIG5vdCBsYXllcmNvbmY6CisgICAg
ICAgICAgICAgICAgbXNnICs9ICgiIGFuZCBiaXRiYWtlIGRpZCBub3QgZmluZCBhIGNvbmYvYmJs
YXllcnMuY29uZiBmaWxlIGluIgorICAgICAgICAgICAgICAgICAgICAgICAgIiB0aGUgZXhwZWN0
ZWQgbG9jYXRpb24uXG5NYXliZSB5b3UgYWNjaWRlbnRhbGx5IgorICAgICAgICAgICAgICAgICAg
ICAgICAgIiBpbnZva2VkIGJpdGJha2UgZnJvbSB0aGUgd3JvbmcgZGlyZWN0b3J5PyIpCisgICAg
ICAgICAgICByYWlzZSBTeXN0ZW1FeGl0KG1zZykKIAogICAgICAgICBkYXRhID0gX3BhcnNlKG9z
LnBhdGguam9pbigiY29uZiIsICJiaXRiYWtlLmNvbmYiKSwgZGF0YSkKIAotLSAKMS43LjkuNQoK
</data>

          </attachment>
      

    </bug>

</bugzilla>