<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"><<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>></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 "/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/tests/fetch.py"<wbr>, line<br>
1353, in test_shallow_submodules<br>
fetcher, ud = self.fetch_shallow(uri)<br>
File "/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/tests/fetch.py"<wbr>, line<br>
1198, in fetch_shallow<br>
fetcher, ud = self.fetch_and_unpack(uri)<br>
File "/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/tests/fetch.py"<wbr>, line<br>
1179, in fetch_and_unpack<br>
fetcher.unpack(self.d.getVar('<wbr>WORKDIR'))<br>
File "/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/fetch2/__init__<wbr>.py", line<br>
1762, in unpack<br>
ud.method.unpack(ud, root, self.d)<br>
File "/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/fetch2/gitsm.<wbr>py", line<br>
141, in unpack<br>
<span class=""> runfetchcmd("cp -pr %s %s" % (os.path.join(ud.clonedir,<br>
'modules'), repo_conf), d)<br>
</span> File "/home/ross/Yocto/poky/<wbr>bitbake/lib/bb/fetch2/__init__<wbr>.py", 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>
'/tmp/tmpxi2ydemw/download/<wbr>git2/tmp.tmpxi2ydemw.<wbr>gitsource/modules': No<br>
such file or directory<br>
<br>
Ross<br></blockquote><div><br></div><div>Thanks; I'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 <<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>> wrote:<br>
> Although the submodules' histories have been fetched during the<br>
> do_fetch() phase, the mechanics used to clone the workdir copy<br>
> of the repo haven't been transferring the actual .git/modules<br>
> directory from the repo fetched into downloads/ during the<br>
> fetch task.<br>
><br>
> Fix that, and for good measure also explicitly tell Git to avoid<br>
> hitting the network during do_unpack() of the submodules.<br>
><br>
> [YOCTO #12739]<br>
><br>
> Signed-off-by: Matt Hoosier <<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>><br>
> ---<br>
> lib/bb/fetch2/gitsm.py | 12 +++++++++++-<br>
> 1 file changed, 11 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py<br>
> index 0aff1008..1f3fc443 100644<br>
> --- a/lib/bb/fetch2/gitsm.py<br>
> +++ b/lib/bb/fetch2/gitsm.py<br>
> @@ -132,4 +132,14 @@ class GitSM(Git):<br>
><br>
> if self.uses_submodules(ud, d, ud.destdir):<br>
> runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)<br>
> - runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)<br>
> +<br>
> + # Copy over the submodules' fetched histories too.<br>
> + if ud.bareclone:<br>
> + repo_conf = ud.destdir<br>
> + else:<br>
> + repo_conf = os.path.join(ud.destdir, '.git')<br>
> + runfetchcmd("cp -pr %s %s" % (os.path.join(ud.clonedir, 'modules'), repo_conf), d)<br>
> +<br>
> + # Careful not to hit the network during unpacking; all history should already<br>
> + # be fetched.<br>
> + runfetchcmd(ud.basecmd + " submodule update --init --recursive --no-fetch", d, workdir=ud.destdir)<br>
> --<br>
> 2.13.6<br>
><br>
</div></div><span class="HOEnZb"><font color="#888888">> --<br>
> ______________________________<wbr>_________________<br>
> bitbake-devel mailing list<br>
> <a href="mailto:bitbake-devel@lists.openembedded.org">bitbake-devel@lists.<wbr>openembedded.org</a><br>
> <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>