<div dir="ltr">Hi Mark<br><br>Thank you for the explanation and sorry for the late response from my side.<br>With your help I was successful.<br><br>&gt; On 11/11/18 3:04 PM, Stefan Bigler wrote:<br>&gt; &gt; Hi<br>&gt; &gt; I&#39;m updating from rocko to thud and recognized, that my projects with<br>&gt; &gt; git-submodules cannot be fetched anymore.<br>&gt; &gt; I tried to debug the fetch task, but I failed. I did a small example you should<br>&gt; &gt; have access and it should be easy to reproduce, the repo should be public.<br>&gt; &gt; The recipe works fine with rocko but fails with the latest master branch of poky.<br>&gt; &gt; I&#39;m using gitlab for my repos. When I use https it works also with thud, only<br>&gt; &gt; when *ssh* is used then it fails.<br>&gt; &gt; Below you find the recipe, the console output and the important part of the<br>&gt; &gt; log.do_fetch<br>&gt; &gt; I hope somebody can give me a hint.<br><br>&gt; The previous fetcher handed off everything to git and did not do all of the<br>&gt; validation and network caching/fetching like it should have.  This hid a lot of<br>&gt; problems and prevented the system from being able to use declared mirror resources.<br>&gt;<br>&gt; The new fetcher iterates over the items and calls the regular git fetcher to<br>&gt; pull down the various components.  This ensures that the download directory and<br>&gt; mirrors are used appropriately.<br>&gt;<br>&gt; Below the message:<br><br>&gt; &gt; ERROR: gitsm-test-1.0+gitAUTOINC+5e400c09b7-r0 do_fetch: The URL:<br>&gt; &gt; &#39;gitsm:Bigler/gitsm-test-submodule.git;protocol=git at <a href="http://gitlab.com">gitlab.com</a><br><br>&gt; indicates that the submodule is not defined properly.  If this is legal, then it<br>&gt; may require some kind of a translation that does not exist.<br><br>&gt; See: <a href="http://git.openembedded.org/bitbake/tree/lib/bb/fetch2/gitsm.py">http://git.openembedded.org/bitbake/tree/lib/bb/fetch2/gitsm.py</a><br><br>&gt; Look at lines 86 though 96.  This is where the submodule URLs are constructed.<br>&gt; The current code is expected the submodules to be defined with URIs, NOT SSH<br>&gt; &#39;strings&#39;.<br><br>&gt; i.e.:<br>&gt; http://user@host/path/file<br>&gt; ssh://user@host/path/file<br>&gt; NOT<br>&gt; user at host:path/file<br><br>&gt; It appears that this submodule reference is using the second format, instead of<br>&gt; the actual URI format.  gitlab must be doing something different if it works on<br>&gt; http but not ssh, since typically the .gitmodules are declared in a singular<br>&gt; format by the author of the repository and don&#39;t change, even if the fetch<br>&gt; method of the initial repository changes.<br><br>If I change the .gitmodules to<br><br>[submodule &quot;lib&quot;]<br>    path = lib<br>-    url =       git@gitlab.com:gitsm/gitsm-test-submodule.git<br>+    url = ssh://<a href="http://git@gitlab.com/gitsm/gitsm-test-submodule.git">git@gitlab.com/gitsm/gitsm-test-submodule.git</a><br>       <br>then it works as expected<br>   <br>&gt; Since you have a way to reproduce this, I&#39;d suggest working through that small<br>&gt; section of code and trying to determine if it&#39;s an invalid URI (SSH style) and<br>&gt; then translating it to a URI for this processing.  (If you can make a reproducer<br>&gt; publicly available, then I can try to fix it instead.)<br><br>The repos are available here<br><a href="https://gitlab.com/gitsm/gitsm-test/tree/master">https://gitlab.com/gitsm/gitsm-test/tree/master</a><br><br>&gt; Looking at the git.py, it says the following protocols are supported:<br>&gt; &quot;git&quot;, &quot;http&quot;, &quot;https&quot;, &quot;file&quot;, &quot;ssh&quot; and &quot;rsync&quot;<br><br>&gt; So checking the protocol field for one of those, failing it find it should go<br>&gt; into a translation step most likely.  The result (I would assume) will either be<br>&gt; file or ssh.  If there is a &#39;:&#39;, then most likely it&#39;s an ssh.. and the rules to<br>&gt; make this into a proper URI should be fairly simple.<br><br>With the patch below I *hardcoded* the gitlab format and it works as well, but of course all other will fail.<br>I do not know if there is a good way to detect if secondary format is used and then do the conversion.<br>Anyway, I can live with the standard format and I can change it in my repos.<br><br>bitbake/lib/bb/fetch2/gitsm.py<br>@@ -88,8 +88,17 @@ class GitSM(Git):<br>             module_hash = module_hash.split()[2]<br> <br>             # Build new SRC_URI<br>-            proto = uris[module].split(&#39;:&#39;, 1)[0]<br>-            url = uris[module].replace(&#39;%s:&#39; % proto, &#39;gitsm:&#39;, 1)<br>+            proto = &quot;ssh&quot;<br>+            url   = &quot;gitsm://&quot;<br>+            url  += uris[module].replace(&#39;:&#39;, &#39;/&#39;, 1)<br>+<br>             url += &#39;;protocol=%s&#39; % proto<br><br>-- Stefan<br></div>