Bug 10163 - having a poky git checkout that mixes http and git: urls for remotes fails to build if it is a local project
Summary: having a poky git checkout that mixes http and git: urls for remotes fails to...
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.2 M4
Assignee: Ed Bartosh
QA Contact: Libertad
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-08-18 18:18 UTC by brian avery
Modified: 2016-09-22 08:16 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Used to work)
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 brian avery 2016-08-18 18:18:27 UTC
Steps to reproduce:
have a poky checkout that looks like

origin  http://git.yoctoproject.org/git/poky (fetch)
origin  http://git.yoctoproject.org/git/poky (push)
poky-contrib    ssh://git@git.yoctoproject.org/poky-contrib (fetch)
poky-contrib    ssh://git@git.yoctoproject.org/poky-contrib (push)

---
git checkout -b toaster-next poky-contrib/toaster-next

---
make a local project and try to build something (quilt-native is about the fastest, btw).
The error is :

2016-08-18 11:03:01,047 ERROR runbuilds: Error launching build Existing git repository at /big/src/myBugs/poky, but with different remotes ('origin     http://git.yoctoproject.org/git/poky (fetch), origin    http://git.yoctoproject.org/git/poky (push), poky-contrib      ssh://git@git.yoctoproject.org/poky-contrib (fetch), poky-contrib        ssh://git@git.yoctoproject.org/poky-contrib (push), ', expected 'git://git.yoctoproject.org/poky'). Toaster will not continue out of fear of damaging something.
Traceback (most recent call last):
  File "/big/src/myBugs/poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py", line 67, in schedule
    "%d:%d" % (br.pk, bec.be.pk))
  File "/big/src/myBugs/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py", line 255, in triggerBuild
    layers = self.setLayers(bitbake, layers, targets)
  File "/big/src/myBugs/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py", line 146, in setLayers
    raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl))
bldcontrol.bbcontroller.BuildSetupException: Existing git repository at /big/src/myBugs/poky, but with different remotes ('origin      http://git.yoctoproject.org/git/poky (fetch), origin     http://git.yoctoproject.org/git/poky (push), poky-contrib       ssh://git@git.yoctoproject.org/poky-contrib (fetch), poky-contrib       ssh://git@git.yoctoproject.org/poky-contrib (push), ', expected 'git://git.yoctoproject.org/poky'). Toaster will not continue out of fear of damaging something.
2016-08-18 11:03:02,065 DEBUG Saving error Existing git repository at /big/src/myBugs/poky, but with different remotes ('origin http://git.yoctoproject.org/git/poky (fetch), origin    http://git.yoctoproject.org/git/poky (push), poky-contrib       ssh://git@git.yoctoproject.org/poky-contrib (fetch), poky-contrib       ssh://git@git.yoctoproject.org/poky-contrib (push), ', expected 'git://git.yoctoproject.org/poky'). Toaster will not continue out of fear of damaging something. (Project object failed)
Traceback (most recent call last):
  File "./smoketests.py", line 142, in <module>
    raise Exception("ERROR: Build of {} failed.".format(args.target))
Exception: ERROR: Build of quilt-native failed.



---
This is the commit that started the regression:
33a4006529ca0e463f1e1fc95daef973a6facd3f
Comment 1 brian avery 2016-08-18 18:30:08 UTC
This way works fine for local projects:
 git remote -v
contrib    git://git.yoctoproject.org/poky-contrib (fetch)
contrib    git://git.yoctoproject.org/poky-contrib (push)
origin    git://git.yoctoproject.org/poky (fetch)
origin    git://git.yoctoproject.org/poky (push)

The difference is whether the origin is http or git:
Comment 2 Michael Wood 2016-08-18 18:38:14 UTC
This is because the local project is configured with the layers still as git repositories.

 <object model="orm.layer" pk="1">
    <field type="CharField" name="name">openembedded-core</field>
    <field type="CharField" name="layer_index_url"></field>
    <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
  </object>
  <object model="orm.layer_version" pk="1">
    <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
    <field type="IntegerField" name="layer_source">0</field>
    <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
    <field type="CharField" name="branch">HEAD</field>
    <field type="CharField" name="commit">HEAD</field>
    <field type="CharField" name="dirpath">meta</field>
  </object>

Maybe they should be local layers instead now. I guess this is where we find out why there were those mysterious magic strings in the previous config mechanism! (http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-poky/conf/toasterconf.json#n21).
Comment 4 Ed Bartosh 2016-09-22 08:16:23 UTC
the fix has been merged into poky master