<?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>7505</bug_id>
          
          <creation_ts>2015-03-23 16:04:11 +0000</creation_ts>
          <short_desc>Building imported layers fails in all sorts of interesting ways</short_desc>
          <delta_ts>2015-11-09 13:06:44 +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.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Belen Barros Pena">belen.barros.pena</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>alexandru.costinx.roman</cc>
    
    <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>jessica.zhang</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>49660</commentid>
    <comment_count>0</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-03-23 16:04:11 +0000</bug_when>
    <thetext>3 examples below:

Example 1: 
If you import a layer that has the same git url as an existing layer source layer, setting the revision to a specific commit sha, the build request fails with this error

command: git fetch --all &amp;&amp; git checkout
&quot;57c8e6bffbbef9b2331551093c3436303eb18386&quot; &amp;&amp; git rebase
&quot;origin/57c8e6bffbbef9b2331551093c3436303eb18386&quot;
From git://git.yoctoproject.org/meta-raspberrypi
* [new branch]      ag-dev     -&gt; origin/ag-dev
* [new branch]      daisy      -&gt; origin/daisy
* [new branch]      danny      -&gt; origin/danny
* [new branch]      denzil     -&gt; origin/denzil
* [new branch]      dizzy      -&gt; origin/dizzy
* [new branch]      dora       -&gt; origin/dora
* [new branch]      dylan      -&gt; origin/dylan
* [new branch]      master     -&gt; origin/master
Note: checking out &apos;57c8e6bffbbef9b2331551093c3436303eb18386&apos;.

You are in &apos;detached HEAD&apos; state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 57c8e6b... rpi-base.inc: Include the RPI2 DTB
fatal: Needed a single revision
invalid upstream origin/57c8e6bffbbef9b2331551093c3436303eb18386

*****************************

Example 2: 
If you import a layer with a git url that doesn&apos;t match any existing layers in Toaster, and set the revision to a specific commit sha, you get this error

command: git clone &quot;https://github.com/agherzan/meta-raspberrypi&quot;
--single-branch --branch &quot;b896a7da70dd7a16ba7ffd664f7747cb37e1d142&quot;
&quot;/home/yocto/_meta-raspberrypi_b896a7da70dd7a16ba7ffd664f7747cb37e1d142.toaster_cloned&quot;
Cloning into &apos;/home/yocto/_meta-raspberrypi_b896a7da70dd7a16ba7ffd664f7747cb37e1d142.toaster_cloned&apos;...
warning: Could not find remote branch
b896a7da70dd7a16ba7ffd664f7747cb37e1d142 to clone.
fatal: Remote branch b896a7da70dd7a16ba7ffd664f7747cb37e1d142 not
found in upstream origin
Unexpected end of command stream

*****************************

Example 3:
If you import a layer, and the checkout directory that Toaster creates happens to exist already but with a different origin, you get this error (if you delete the directory, the build works):

Existing git repository at
/home/yocto/_meta-raspberrypi_master.toaster_cloned, but with
different remotes (&apos;origin git://git.yoctoproject.org/meta-raspberrypi
(fetch), origin git://git.yoctoproject.org/meta-raspberrypi (push), &apos;,
expected &apos;https://github.com/agherzan/meta-raspberrypi&apos;). Toaster will
not continue out of fear of damaging something.

*****************************

The fact that you can not build a layer when you set the revision to a certain commit sounds a bit worrying to me, but I could be totally wrong (maybe nobody would ever want to do something like that).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53234</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-08-19 15:52:55 +0000</bug_when>
    <thetext>Possible fix hint, add git url/hash to make the clone directory unique</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54427</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-22 10:06:19 +0000</bug_when>
    <thetext>Started to work on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54450</commentid>
    <comment_count>3</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-09-22 14:51:40 +0000</bug_when>
    <thetext>Example 3 is covered by bug 8101

To reproduce the other 2 examples, you can do the following. 

Example 1: 

1) create a project with the master release 
2) import a layer with 

name: &apos;meta-raspberrypi-test&apos;
git url: git://git.yoctoproject.org/meta-raspberrypi
revision: 17dad9328b100beda1cf870c9075e509b5cbfa90 

3) start a build for rpi-basic-image

Example 2: 

1) delete the 

_meta-raspberrypi_17dad9328b100beda1cf870c9075e509b5cbfa90.toaster_cloned 

directory that was created during the previous build 
2) delete the meta-raspberrypi-test layer from the list of project layers in your configuration 
3) import a new layer with 

name: meta-raspberrypi-test2
git url: https://github.com/agherzan/meta-raspberrypi.git
revision: 17dad9328b100beda1cf870c9075e509b5cbfa90 

4) start a build for rpi-basic-image</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54515</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-23 11:02:53 +0000</bug_when>
    <thetext>Pushed fixes for first 2 examples to ed/toaster/7505. Please, review.
Example 3 is covered in bug 8101 and will be fixed there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54837</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-30 14:58:15 +0000</bug_when>
    <thetext>merged to bitbake master: http://cgit.openembedded.org/bitbake/commit/?id=f3641a8422e67890410594453b8baf362c27df2b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56318</commentid>
    <comment_count>6</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2015-11-09 13:06:44 +0000</bug_when>
    <thetext>Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>