<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 11, 2018 at 7:28 AM, Burton, Ross <span dir="ltr">&lt;<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This breaks bitbake-selftest:<br>
<br>
$ bitbake-selftest  bb.tests.fetch.GitShallowTest<br>
........................E<br>
<br>
ERROR: test_shallow_submodules (bb.tests.fetch.<wbr>GitShallowTest)<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
Traceback (most recent call last):<br>
  File &quot;/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/tests/fetch.py&quot;<wbr>, line<br>
1353, in test_shallow_submodules<br>
    fetcher, ud = self.fetch_shallow(uri)<br>
  File &quot;/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/tests/fetch.py&quot;<wbr>, line<br>
1198, in fetch_shallow<br>
    fetcher, ud = self.fetch_and_unpack(uri)<br>
  File &quot;/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/tests/fetch.py&quot;<wbr>, line<br>
1179, in fetch_and_unpack<br>
    fetcher.unpack(self.d.getVar(&#39;<wbr>WORKDIR&#39;))<br>
  File &quot;/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/fetch2/__init__<wbr>.py&quot;, line<br>
1762, in unpack<br>
    ud.method.unpack(ud, root, self.d)<br>
  File &quot;/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/fetch2/gitsm.<wbr>py&quot;, line<br>
141, in unpack<br>
<span class="">    runfetchcmd(&quot;cp -pr %s %s&quot; % (os.path.join(ud.clonedir,<br>
&#39;modules&#39;), repo_conf), d)<br>
</span>  File &quot;/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/fetch2/__init__<wbr>.py&quot;, line<br>
885, in runfetchcmd<br>
    raise FetchError(error_message)<br>
bb.fetch2.FetchError: Fetcher failure: Fetch command export<br>
PSEUDO_DISABLED=1; cp -pr<br>
/tmp/tmpxi2ydemw/download/<wbr>git2/tmp.tmpxi2ydemw.<wbr>gitsource/modules<br>
/tmp/tmpxi2ydemw/git/.git failed with exit code 1, output:<br>
cp: cannot stat<br>
&#39;/tmp/tmpxi2ydemw/download/<wbr>git2/tmp.tmpxi2ydemw.<wbr>gitsource/modules&#39;: No<br>
such file or directory<br>
<br>
Ross<br></blockquote><div><br></div><div>Thanks; I&#39;d not considered shallow mirrored clones; rev2 fixes this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
On 10 May 2018 at 03:33, Matt Hoosier &lt;<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>&gt; wrote:<br>
&gt; Although the submodules&#39; histories have been fetched during the<br>
&gt; do_fetch() phase, the mechanics used to clone the workdir copy<br>
&gt; of the repo haven&#39;t been transferring the actual .git/modules<br>
&gt; directory from the repo fetched into downloads/ during the<br>
&gt; fetch task.<br>
&gt;<br>
&gt; Fix that, and for good measure also explicitly tell Git to avoid<br>
&gt; hitting the network during do_unpack() of the submodules.<br>
&gt;<br>
&gt; [YOCTO #12739]<br>
&gt;<br>
&gt; Signed-off-by: Matt Hoosier &lt;<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;  lib/bb/fetch2/gitsm.py | 12 +++++++++++-<br>
&gt;  1 file changed, 11 insertions(+), 1 deletion(-)<br>
&gt;<br>
&gt; diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py<br>
&gt; index 0aff1008..1f3fc443 100644<br>
&gt; --- a/lib/bb/fetch2/gitsm.py<br>
&gt; +++ b/lib/bb/fetch2/gitsm.py<br>
&gt; @@ -132,4 +132,14 @@ class GitSM(Git):<br>
&gt;<br>
&gt;          if self.uses_submodules(ud, d, ud.destdir):<br>
&gt;              runfetchcmd(ud.basecmd + &quot; checkout &quot; + ud.revisions[ud.names[0]], d, workdir=ud.destdir)<br>
&gt; -            runfetchcmd(ud.basecmd + &quot; submodule update --init --recursive&quot;, d, workdir=ud.destdir)<br>
&gt; +<br>
&gt; +            # Copy over the submodules&#39; fetched histories too.<br>
&gt; +            if ud.bareclone:<br>
&gt; +                repo_conf = ud.destdir<br>
&gt; +            else:<br>
&gt; +                repo_conf = os.path.join(ud.destdir, &#39;.git&#39;)<br>
&gt; +            runfetchcmd(&quot;cp -pr %s %s&quot; % (os.path.join(ud.clonedir, &#39;modules&#39;), repo_conf), d)<br>
&gt; +<br>
&gt; +            # Careful not to hit the network during unpacking; all history should already<br>
&gt; +            # be fetched.<br>
&gt; +            runfetchcmd(ud.basecmd + &quot; submodule update --init --recursive --no-fetch&quot;, d, workdir=ud.destdir)<br>
&gt; --<br>
&gt; 2.13.6<br>
&gt;<br>
</div></div><span class="HOEnZb"><font color="#888888">&gt; --<br>
&gt; ______________________________<wbr>_________________<br>
&gt; bitbake-devel mailing list<br>
&gt; <a href="mailto:bitbake-devel@lists.openembedded.org">bitbake-devel@lists.<wbr>openembedded.org</a><br>
&gt; <a href="http://lists.openembedded.org/mailman/listinfo/bitbake-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/bitbake-devel</a><br>
</font></span></blockquote></div><br></div></div>