[yocto] bitbake SRC_URI fetch Azure DevOps repository Azure DevOps Services Basic

Samuel Jiang (江騏先) Samuel.Jiang at quantatw.com
Wed Nov 20 00:23:43 PST 2019


Hi Richard,
Thanks for your patch which could work for us.
I study git-clone document and found the git urls support alternative scp-like syntax like below:

[user@]host.xz:path/to/repo.git/

It seems like Azure DevOps provides SSH url.
Will yocto support this alternative url?

Thanks, 
Samuel Jiang

-----Original Message-----
From: Richard Purdie <richard.purdie at linuxfoundation.org> 
Sent: Thursday, November 14, 2019 2:52 AM
To: Samuel Jiang (江騏先) <Samuel.Jiang at quantatw.com>; yocto at yoctoproject.org
Cc: Alex Chong <v-chucho at microsoft.com>
Subject: Re: [yocto] bitbake SRC_URI fetch Azure DevOps repository Azure DevOps Services Basic

On Wed, 2019-11-13 at 09:02 +0000, Samuel Jiang (江騏先) wrote:
> I got below error message:
> crashdump-git-r0 do_fetch: Fetcher failure: Fetch command export 
> PSEUDO_DISABLED=1; unset _PYTHON_SYSCONFIGDATA_NAME; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="2255"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="[private_data]"; export HOME="/home/samueljiang"; git -c core.fsyncobjectfiles=0 ls-remote git://quanta01.visualstudio.com/OpenBMC/_git/crashdump  failed with exit code 128, output:
> fatal: unable to connect to quanta01.visualstudio.com:
> quanta01.visualstudio.com[0: 2620:1ec:21::18]: errno=Network is 
> unreachable
> quanta01.visualstudio.com[1: 13.107.42.18]: errno=Connection timed out
> 
> Seems this url with git:// prefix could not connect in Azure DevOps
> 
> Document[https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops].

I now realise what the problem is. Whatever this git server you're talking to is, it does not work the same as is documented for the "git clone" manpage.

There is no option to force bitbake to use the syntax you're asking for since the manpage says the synax its using is valid. You could patch bitbake to force it to use that syntax with a patch like:

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index fa41b078f12..f20c1f36b82 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -588,6 +588,8 @@ class Git(FetchMethod):
             username = ud.user + '@'
         else:
             username = ""
+        if ud.proto == "ssh":
+            return "%s%s:%s" % (username, ud.host, ud.path[1:])
         return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
 
     def _revision_key(self, ud, d, name):


which in my local tests appeared to give the result you're asking for but that shouldn't be required with a server that adheres to what the git manual says is supported.

Cheers,

Richard



More information about the yocto mailing list