All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Burton, Ross" <ross.burton@intel.com>
To: Matt Hoosier <matt.hoosier@gmail.com>
Cc: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH] fetch/gitsm: avoid live submodule fetching during unpack()
Date: Fri, 11 May 2018 13:28:34 +0100	[thread overview]
Message-ID: <CAJTo0LYFNknuqk_xyecvEgDFweFr5vXFwu3N5bNkLZDdcq=4Nw@mail.gmail.com> (raw)
In-Reply-To: <20180510023357.96409-1-matt.hoosier@gmail.com>

This breaks bitbake-selftest:

$ bitbake-selftest  bb.tests.fetch.GitShallowTest
........................E

ERROR: test_shallow_submodules (bb.tests.fetch.GitShallowTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ross/Yocto/poky/bitbake/lib/bb/tests/fetch.py", line
1353, in test_shallow_submodules
    fetcher, ud = self.fetch_shallow(uri)
  File "/home/ross/Yocto/poky/bitbake/lib/bb/tests/fetch.py", line
1198, in fetch_shallow
    fetcher, ud = self.fetch_and_unpack(uri)
  File "/home/ross/Yocto/poky/bitbake/lib/bb/tests/fetch.py", line
1179, in fetch_and_unpack
    fetcher.unpack(self.d.getVar('WORKDIR'))
  File "/home/ross/Yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line
1762, in unpack
    ud.method.unpack(ud, root, self.d)
  File "/home/ross/Yocto/poky/bitbake/lib/bb/fetch2/gitsm.py", line
141, in unpack
    runfetchcmd("cp -pr %s %s" % (os.path.join(ud.clonedir,
'modules'), repo_conf), d)
  File "/home/ross/Yocto/poky/bitbake/lib/bb/fetch2/__init__.py", line
885, in runfetchcmd
    raise FetchError(error_message)
bb.fetch2.FetchError: Fetcher failure: Fetch command export
PSEUDO_DISABLED=1; cp -pr
/tmp/tmpxi2ydemw/download/git2/tmp.tmpxi2ydemw.gitsource/modules
/tmp/tmpxi2ydemw/git/.git failed with exit code 1, output:
cp: cannot stat
'/tmp/tmpxi2ydemw/download/git2/tmp.tmpxi2ydemw.gitsource/modules': No
such file or directory

Ross

On 10 May 2018 at 03:33, Matt Hoosier <matt.hoosier@gmail.com> wrote:
> Although the submodules' histories have been fetched during the
> do_fetch() phase, the mechanics used to clone the workdir copy
> of the repo haven't been transferring the actual .git/modules
> directory from the repo fetched into downloads/ during the
> fetch task.
>
> Fix that, and for good measure also explicitly tell Git to avoid
> hitting the network during do_unpack() of the submodules.
>
> [YOCTO #12739]
>
> Signed-off-by: Matt Hoosier <matt.hoosier@gmail.com>
> ---
>  lib/bb/fetch2/gitsm.py | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
> index 0aff1008..1f3fc443 100644
> --- a/lib/bb/fetch2/gitsm.py
> +++ b/lib/bb/fetch2/gitsm.py
> @@ -132,4 +132,14 @@ class GitSM(Git):
>
>          if self.uses_submodules(ud, d, ud.destdir):
>              runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)
> -            runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)
> +
> +            # Copy over the submodules' fetched histories too.
> +            if ud.bareclone:
> +                repo_conf = ud.destdir
> +            else:
> +                repo_conf = os.path.join(ud.destdir, '.git')
> +            runfetchcmd("cp -pr %s %s" % (os.path.join(ud.clonedir, 'modules'), repo_conf), d)
> +
> +            # Careful not to hit the network during unpacking; all history should already
> +            # be fetched.
> +            runfetchcmd(ud.basecmd + " submodule update --init --recursive --no-fetch", d, workdir=ud.destdir)
> --
> 2.13.6
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel


  reply	other threads:[~2018-05-11 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  2:33 [PATCH] fetch/gitsm: avoid live submodule fetching during unpack() Matt Hoosier
2018-05-11 12:28 ` Burton, Ross [this message]
2018-05-11 13:55   ` Matt Hoosier
2018-05-11 13:53 Matt Hoosier
2018-05-11 19:32 ` Matt Hoosier
2018-05-11 19:26 Matt Hoosier
2018-05-14 13:18 ` Peter Kjellerstedt
2018-05-14 18:51   ` Matt Hoosier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJTo0LYFNknuqk_xyecvEgDFweFr5vXFwu3N5bNkLZDdcq=4Nw@mail.gmail.com' \
    --to=ross.burton@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=matt.hoosier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.