<?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>8101</bug_id>
          
          <creation_ts>2015-08-05 10:06:52 +0000</creation_ts>
          <short_desc>Cloning via http prevents Toaster from building</short_desc>
          <delta_ts>2015-11-02 14:13:54 +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>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>Low</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>brian.avery</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>eduard.bartosh</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>52831</commentid>
    <comment_count>0</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-08-05 10:06:52 +0000</bug_when>
    <thetext>If I clone the poky repo using http:// instead of git://, the resulting Toaster instance will not build. Builds fail before layer cloning starts with this error:

File &quot;/home/yocto/toaster-master/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py&quot;, line 59, in schedule
    bec.triggerBuild(br.brbitbake_set.all(), br.brlayer_set.all(), br.brvariable_set.all(), br.brtarget_set.all())
  File &quot;/home/yocto/toaster-master/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py&quot;, line 319, in triggerBuild
    self.setLayers(bitbake, layers)
  File &quot;/home/yocto/toaster-master/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py&quot;, line 255, in setLayers
    raise BuildSetupException(&quot;Existing git repository at %s, but with different remotes (&apos;%s&apos;, expected &apos;%s&apos;). Toaster will not continue out of fear of damaging something.&quot; % (localdirname, &quot;, &quot;.join(localremotes.split(&quot;\n&quot;)), giturl))
BuildSetupException: Existing git repository at /home/yocto/_poky_master.toaster_cloned, but with different remotes (&apos;origin    git://git.yoctoproject.org/poky.git (fetch), origin    git://git.yoctoproject.org/poky.git (push), &apos;, expected &apos;http://git.yoctoproject.org/git/poky&apos;). Toaster will not continue out of fear of damaging something.

This is Michael&apos;s explanation of the problem: &quot;It&apos;s because you have an existing repo cloned by toaster using a different remote (git url) and it can&apos;t clone it because it will overwrite the existing cloned repo&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53448</commentid>
    <comment_count>1</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2015-08-26 21:09:30 +0000</bug_when>
    <thetext>I did:
git clone http://git.yoctoproject.org/git/poky
mkdir toaster_run
cd toaster_run/
TOASTER_MANAGED=1 TOASTER_DEVEL=1  ../poky/bitbake/bin/toaster webport=8005
-- I built bash off of master branch and it succeeded --</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53467</commentid>
    <comment_count>2</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-08-27 10:05:11 +0000</bug_when>
    <thetext>It turns out the builds only fail when Toaster finds an exiting poky repository that matches the one it is trying to create. 

This is what I did:

git clone http://git.yoctoproject.org/git/poky --branch master --single-branch 8101

cd 8101

bitbake/bin/toaster

used defaults for artifacts and checkout directory, and specified /home/8101/build as the build directory

created a project selecting the master release

tried to build bash

the build failed with this message:

Existing git repository at /home/yocto/_poky_master.toaster_cloned, but with different remotes (&apos;origin	git://git.yoctoproject.org/poky (fetch), origin	git://git.yoctoproject.org/poky (push), &apos;, expected &apos;http://git.yoctoproject.org/git/poky&apos;). Toaster will not continue out of fear of damaging something.

Then I stopped Toaster, went to my layers checkout directory and deleted the directory Toaster complains about

/home/yocto/_poky_master.toaster_cloned

Restarted Toaster, and fired a new build for bash: the build finished without problems. So the issue is not the cloning with http:// per se, but Toaster bailing out when it finds an existing poky repository in the layer checkout directory that has a different git URI to the one Toaster is supposed to clone from. 

I would have assumed that if this happens Toaster would simply make a new clone, but I really have no idea of what I am talking about, so this might cause new problems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54028</commentid>
    <comment_count>3</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2015-09-14 16:30:11 +0000</bug_when>
    <thetext>Needinfo answered.  Please ask another question if you still need infomation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54108</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2015-09-15 19:30:37 +0000</bug_when>
    <thetext>changed to low priority as this is a bit of a corner case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54453</commentid>
    <comment_count>5</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-09-22 14:54:53 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; changed to low priority as this is a bit of a corner case.

I am not so sure this is a corner case: I think the moment you start using imported layers, you are bound to hit this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54467</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-22 15:20:33 +0000</bug_when>
    <thetext>Brian, I&apos;ll take this if you don&apos;t mind.
I&apos;m working on bug 7505. This bug is mentioned in bug 7505 as an &apos;Example 3&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54474</commentid>
    <comment_count>7</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2015-09-22 15:46:58 +0000</bug_when>
    <thetext>fine by me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54531</commentid>
    <comment_count>8</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-23 13:20:10 +0000</bug_when>
    <thetext>I decided to make remote name out of git url and allow one clone to have different remotes. So, for example for url https://github.com/agherzan/meta-raspberrypi.git remote name will be https___github.com_agherzan_meta-raspberrypi.git and for url git://github.com/agherzan/meta-raspberrypi.git remote will be different: git___github.com_agherzan_meta-raspberrypi.git

The advantage of this approach is that multiple remotes will share git objects and fetching will be faster than if they&apos;re in different clones.

It would be even better to remove branch name from the directory name. This would allow to have one clone directory for one layer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54537</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-23 14:11:31 +0000</bug_when>
    <thetext>Nope, this approach will not work as multiple layers can&apos;t be accessed by bitbake without resetting git tree. It&apos;s better to have clones in separate directories as Michael suggested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54590</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-24 07:55:30 +0000</bug_when>
    <thetext>Submitted to upstream: http://lists.openembedded.org/pipermail/bitbake-devel/2015-September/006423.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54834</commentid>
    <comment_count>11</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-09-30 14:54:57 +0000</bug_when>
    <thetext>Merged into bitbake master: http://cgit.openembedded.org/bitbake/commit/?id=a9baf856a1ef7d84a47fa6615353f5b3fdb8a73b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56092</commentid>
    <comment_count>12</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2015-11-02 14:12:14 +0000</bug_when>
    <thetext>Verified on master: 370a2916c4559c17952392b872322e8e490b124c</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>