Bug 8463 - toaster looks into the wrong directories for already cloned layers
Summary: toaster looks into the wrong directories for already cloned layers
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.0
Hardware: x86 Multiple
: Medium major
Target Milestone: 2.0
Assignee: Michael Wood
QA Contact: Alexandru Roman
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-10-08 11:03 UTC by Michael Wood
Modified: 2015-11-10 13:43 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wood 2015-10-08 11:03:06 UTC
Due to the change in layer location/checkout name we get an exception on starting the build because the cloned layer location is wrong.

  File "/home/michael/toaster/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py", line 362, in triggerBuild
    self.setLayers(bitbake, layers, targets)
  File "/home/michael/toaster/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py", line 256, in setLayers
    self._shellcmd("git clone \"%s\" \"%s\"" % (cached_layers[giturl], localdirname))
  File "/home/michael/toaster/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py", line 69, in _shellcmd
    raise ShellCmdException(err)
ShellCmdException: command: git clone "/home/michael/toaster/poky/scripts" "/home/michael/toaster/poky/_toaster_clones/_git___git.yoctoproject.org_poky_fido" 
fatal: repository '/home/michael/toaster/poky/scripts' does not exist

cached layers generated is: 
{'git://git.yoctoproject.org/poky-contrib': u'/home/michael/toaster/poky/scripts', 'git://git.yoctoproject.org/poky': u'/home/michael/toaster/poky/scripts'}

As you can see the directory that it is picking up the checkout in is not the top level directory and so the clone fails.

As toaster makes use of clones of itself we have a mechanism to just clone the current checkout and use that as a basis for the git clone for the layers inside. For instance in poky if we're running in that directory we don't ever want to change the current checkout so we make a copy of ourselves to do this work in. This step is cached_layers and previously traversed through directories inside the current checkout to find any pre-existing checkouts. This was ending up traversing too many directories down so remove the traverse and only deal with the current directory.
Comment 2 Alexandru Roman 2015-11-10 13:43:18 UTC
Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1