<?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>8267</bug_id>
          
          <creation_ts>2015-09-08 09:27:24 +0000</creation_ts>
          <short_desc>Traceback with recipe folder containing a space</short_desc>
          <delta_ts>2015-11-16 13:06:46 +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>1.8</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>minor</bug_severity>
          <target_milestone>2.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>costin.c.constantin</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="Costin">costin.c.constantin</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>New (Never tested)</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>53829</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-09-08 09:27:24 +0000</bug_when>
    <thetext>If a directory containing a recipe has a space in its name and the recipe has a local file in SRC_URI, you will receive an error during parse:

----------- snip -----------
ERROR: Command execution failed: Traceback (most recent call last):
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/command.py&quot;, line 101, in runAsyncCommand
    self.cooker.updateCache()
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/cooker.py&quot;, line 1514, in updateCache
    self.parser = CookerParser(self, filelist, masked)
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/cooker.py&quot;, line 1963, in __init__
    if not self.bb_cache.cacheValid(filename, appends):
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/cache.py&quot;, line 471, in cacheValid
    self.cacheValidUpdate(fn, appends)
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/cache.py&quot;, line 534, in cacheValidUpdate
    f, exist = f.split(&quot;:&quot;)
ValueError: need more than 1 value to unpack
----------- snip -----------

I&apos;m not sure how but at one point I was actually able to get past parsing and start a build but then it blew up in the runqueue:

----------- snip -----------
NOTE: Preparing RunQueue
ERROR: An uncaught exception occured in runqueue, please see the failure below:
ERROR: Running idle function
Traceback (most recent call last):
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/runqueue.py&quot;, line 1031, in RunQueue._execute_runqueue():
                 self.rqexe = RunQueueExecuteDummy(self)
    &gt;            if self.rqdata.prepare() == 0:
                     self.state = runQueueComplete
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/runqueue.py&quot;, line 811, in RunQueueData.prepare():
                             procdep.append(self.taskData.fn_index[self.runq_fnid[dep]] + &quot;.&quot; + self.runq_task[dep])
    &gt;                    self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache)

  File &quot;/home/paul/poky/poky/meta/lib/oe/sstatesig.py&quot;, line 113, in SignatureGeneratorOEBasicHash.get_taskhash(fn=&apos;/home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot.bb&apos;, task=&apos;do_fetch&apos;, deps=[], dataCache=&lt;bb.cache.CacheData object at 0x7fe7117d4e50&gt;):
         def get_taskhash(self, fn, task, deps, dataCache):
    &gt;        h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(fn, task, deps, dataCache)

  File &quot;/home/paul/poky/poky/bitbake/lib/bb/siggen.py&quot;, line 192, in SignatureGeneratorOEBasicHash.get_taskhash(fn=&apos;/home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot.bb&apos;, task=&apos;do_fetch&apos;, deps=[], dataCache=&lt;bb.cache.CacheData object at 0x7fe7117d4e50&gt;):
             if task in dataCache.file_checksums[fn]:
    &gt;            checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename)
                 for (f,cs) in checksums:
  File &quot;/home/paul/poky/poky/bitbake/lib/bb/fetch2/__init__.py&quot;, line 1139, in get_file_checksums(filelist=&apos;/home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot-1.0/poky/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot/poky/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/files/poky/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot-1.0/qemux86-64/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot/qemux86-64/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/files/qemux86-64/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot-1.0/qemuall/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot/qemuall/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/files/qemuall/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot-1.0/x86-64/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot/x86-64/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/files/x86-64/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot-1.0/testfile:False /home/paul/poky/poky/meta/recipes-core/fb-uc1701-mod (wip)/woot/testfile:True  &apos;, pn=&apos;woot&apos;):
         for pth in filelist.split():
    &gt;        exist = pth.split(&quot;:&quot;)[1]
             if exist == &quot;False&quot;:
IndexError: list index out of range
----------- snip -----------

The reason for this is most likely that the &quot;file-checksums&quot; varflag that base.bbclass sets (which is read by bitbake) is space-separated. The filename and checksum in each item are separated by colons as well so a colon in the path would probably break the code too.

(Mostly this is a case of &quot;don&apos;t do that!&quot; but we should be displaying a proper error instead of these nasty tracebacks).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54113</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-09-15 21:04:07 +0000</bug_when>
    <thetext>From 21de5ef838d7f4aeeeb91752572cb19d877c1520 Mon Sep 17 00:00:00 2001
From: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date: Tue, 15 Sep 2015 20:43:34 +0000
Subject: cache: Handle spaces and colons in directory names for file-checksums

If there is a space in a directory name containing a file in file-checksums
(e.g. from a file:// url), you currently get tracebacks from bitbake. This
improves the code to handle colons and spaces in the file-checksums names
since it possible to figure out the correct names.

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index ef4d660..ab09b08 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -528,7 +528,20 @@ class Cache(object):
 
         if hasattr(info_array[0], &apos;file_checksums&apos;):
             for _, fl in info_array[0].file_checksums.items():
-                for f in fl.split():
+                fl = fl.strip()
+                while fl:
+                    # A .split() would be simpler but means spaces or colons in filenames would break
+                    a = fl.find(&quot;:True&quot;)
+                    b = fl.find(&quot;:False&quot;)
+                    if ((a &lt; 0) and b) or ((b &gt; 0) and (b &lt; a)):
+                       f = fl[:b+6]
+                       fl = fl[b+7:]
+                    elif ((b &lt; 0) and a) or ((a &gt; 0) and (a &lt; b)):
+                       f = fl[:a+5]
+                       fl = fl[a+6:]
+                    else:
+                       break
+                    fl = fl.strip()
                     if &quot;*&quot; in f:
                         continue
                     f, exist = f.split(&quot;:&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54850</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-10-01 07:09:03 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=ross/mut&amp;id=07aef86c3a5fde8c335c6697ebbb751f79bbde1d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56202</commentid>
    <comment_count>3</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-11-04 16:10:06 +0000</bug_when>
    <thetext>Tested on last master commit fc45deac89ef63ca1c44e763c38ced7dfd72cbe1 on an Ubuntu 15.04 OS.

Steps i performed:
1) ~/costin-poky/meta/recipes-graphics$ pwd
/home/autobuilder/costin-poky/meta/recipes-graphics
~/costin-poky/meta/recipes-graphics$ mv xcursor-transparent-theme/ xcursor-transparent-\ theme/

2)~/costin-poky/meta/recipes-graphics$ bitbake xcursor-transparent-theme

and i get the same error messages as on comment#1.

I observed after that the patch is on contrib. not on master

reopening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56203</commentid>
    <comment_count>4</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-11-04 16:10:52 +0000</bug_when>
    <thetext>i guess the best status would be WaitingForUpstrem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56238</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-11-05 16:22:21 +0000</bug_when>
    <thetext>This was merged into bitbake as 87282b283921a58426f24fb21151db457c5bca66 and poky as 07aef86c3a5fde8c335c6697ebbb751f79bbde1d, which made it into 2.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56296</commentid>
    <comment_count>6</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-11-06 15:17:05 +0000</bug_when>
    <thetext>Marking as verified</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>