Search code examples
giturlyocto-recipe

Yocto SRC_URI needs slash '/' but Git repo path has colon ':'


I'm trying to specify SRC_URI in my Yocto recipe but the necessary colon is illegal. From a shell:

git clone [email protected]:mycompany/myrepo.git    # WORKS
git clone [email protected]/mycompany/myrepo.git    # DOES NOT WORK

But Yocto recipe syntax won't accept the : and requires that I replace it with / and, as with the shell command, it fails.

In my recipe:

SRC_URI?= "git://[email protected]:mycompany/myrepo.git;protocol=git;branch=mybranch"

causes the build to fail immediately with a python error to effect of:

poky/meta/classes/base.bbclass
  uri = bb.fetch.URI(uri_string)
  self.port = urlp.port
    port = int(port, 10)
    Port could not be cast to integer value as 'mycompany'

An this one (with / instead of :)

SRC_URI?= "git://[email protected]/mycompany/myrepo.git;protocol=git;branch=mybranch"

Fails with:

ERROR: linux-socfpga-lts-5.4.124-lts+gitAUTOINC+d4d238db6e-r0 do_fetch: Fetcher failure for URL: 
'git://[email protected]/mycompany/myrepo.git;protocol=git;branch=mybranch'. Unable to fetch URL from any source.

I have also tried the SRC_URI definitions without the git@ part, and also with protocol=http. No combination has worked. How do I get around the incompatible URL syntax between Bitbucket repo and Bitbake?


Solution

  • ElpieKay had the answer with the appropriate link to explain the options. This worked for me:

    SRC_URI = "git://[email protected]/mycompany/myrepo.git;protocol=ssh;branch=mtbranch;"