All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack()
@ 2018-05-09 21:48 Matt Hoosier
  2018-05-09 23:27 ` Andre McCurdy
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Hoosier @ 2018-05-09 21:48 UTC (permalink / raw)
  To: yocto; +Cc: Matt Hoosier

From: Matt Hoosier <matt.hoosier@garmin.com>

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.

Ref:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12739
---
 bitbake/lib/bb/fetch2/gitsm.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index 0aff1008e5..1f3fc44352 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack()
  2018-05-09 21:48 [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack() Matt Hoosier
@ 2018-05-09 23:27 ` Andre McCurdy
  2018-05-10  0:40   ` Matt Hoosier
  0 siblings, 1 reply; 5+ messages in thread
From: Andre McCurdy @ 2018-05-09 23:27 UTC (permalink / raw)
  To: Matt Hoosier; +Cc: Yocto discussion list, Matt Hoosier

On Wed, May 9, 2018 at 2:48 PM, Matt Hoosier <matt.hoosier@gmail.com> wrote:
> From: Matt Hoosier <matt.hoosier@garmin.com>
>
> 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.
>
> Ref:
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=12739

Patches for bitbake should be sent to the bitbake-devel mailing list:

  http://lists.openembedded.org/mailman/listinfo/bitbake-devel

> ---
>  bitbake/lib/bb/fetch2/gitsm.py | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
> index 0aff1008e5..1f3fc44352 100644
> --- a/bitbake/lib/bb/fetch2/gitsm.py
> +++ b/bitbake/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
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack()
  2018-05-09 23:27 ` Andre McCurdy
@ 2018-05-10  0:40   ` Matt Hoosier
  2018-05-10  1:05     ` Andre McCurdy
  2018-05-10 16:34     ` Burton, Ross
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Hoosier @ 2018-05-10  0:40 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 2513 bytes --]

On Wed, May 9, 2018 at 6:27 PM, Andre McCurdy <armccurdy@gmail.com> wrote:

> On Wed, May 9, 2018 at 2:48 PM, Matt Hoosier <matt.hoosier@gmail.com>
> wrote:
> > From: Matt Hoosier <matt.hoosier@garmin.com>
> >
> > 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.
> >
> > Ref:
> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=12739
>
> Patches for bitbake should be sent to the bitbake-devel mailing list:
>
>   http://lists.openembedded.org/mailman/listinfo/bitbake-devel



Right, okay. How's that meant to work for stuff developed in-tree with
poky? Do you manually want the 'bitbake/' leading directory stripped off
before emailing the patch?



>
>
> > ---
> >  bitbake/lib/bb/fetch2/gitsm.py | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/bitbake/lib/bb/fetch2/gitsm.py
> b/bitbake/lib/bb/fetch2/gitsm.py
> > index 0aff1008e5..1f3fc44352 100644
> > --- a/bitbake/lib/bb/fetch2/gitsm.py
> > +++ b/bitbake/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
> >
> > --
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 3959 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack()
  2018-05-10  0:40   ` Matt Hoosier
@ 2018-05-10  1:05     ` Andre McCurdy
  2018-05-10 16:34     ` Burton, Ross
  1 sibling, 0 replies; 5+ messages in thread
From: Andre McCurdy @ 2018-05-10  1:05 UTC (permalink / raw)
  To: Matt Hoosier; +Cc: Yocto discussion list

On Wed, May 9, 2018 at 5:40 PM, Matt Hoosier <matt.hoosier@gmail.com> wrote:
> On Wed, May 9, 2018 at 6:27 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>>
>> On Wed, May 9, 2018 at 2:48 PM, Matt Hoosier <matt.hoosier@gmail.com>
>> wrote:
>> > From: Matt Hoosier <matt.hoosier@garmin.com>
>> >
>> > 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.
>> >
>> > Ref:
>> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=12739
>>
>> Patches for bitbake should be sent to the bitbake-devel mailing list:
>>
>>   http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
> Right, okay. How's that meant to work for stuff developed in-tree with poky?
> Do you manually want the 'bitbake/' leading directory stripped off before
> emailing the patch?

Yes, patches for bitbake should apply directly to a clone of the bitbake repo.

Manually editing a patch created from poky is certainly do-able, but
applying the patch to a genuine bikebake repo (with "git am -p2 ...")
and re-generating the patch from there may be safer. Whichever you
prefer.

>> > ---
>> >  bitbake/lib/bb/fetch2/gitsm.py | 12 +++++++++++-
>> >  1 file changed, 11 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/bitbake/lib/bb/fetch2/gitsm.py
>> > b/bitbake/lib/bb/fetch2/gitsm.py
>> > index 0aff1008e5..1f3fc44352 100644
>> > --- a/bitbake/lib/bb/fetch2/gitsm.py
>> > +++ b/bitbake/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
>> >
>> > --
>> > _______________________________________________
>> > yocto mailing list
>> > yocto@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/yocto
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack()
  2018-05-10  0:40   ` Matt Hoosier
  2018-05-10  1:05     ` Andre McCurdy
@ 2018-05-10 16:34     ` Burton, Ross
  1 sibling, 0 replies; 5+ messages in thread
From: Burton, Ross @ 2018-05-10 16:34 UTC (permalink / raw)
  To: Matt Hoosier; +Cc: Yocto discussion list

On 10 May 2018 at 01:40, Matt Hoosier <matt.hoosier@gmail.com> wrote:
> On Wed, May 9, 2018 at 6:27 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>>
>> On Wed, May 9, 2018 at 2:48 PM, Matt Hoosier <matt.hoosier@gmail.com>
>> wrote:
>> > From: Matt Hoosier <matt.hoosier@garmin.com>
>> >
>> > 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.
>> >
>> > Ref:
>> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=12739
>>
>> Patches for bitbake should be sent to the bitbake-devel mailing list:
>>
>>   http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
>
>
> Right, okay. How's that meant to work for stuff developed in-tree with poky?
> Do you manually want the 'bitbake/' leading directory stripped off before
> emailing the patch?

If you're feeling lazy you can just send the patch to bitbake@ from a
poky repo and git will figure it out.  The same works the other way: a
bitbake patch applies fine to a poky repository.

Ross


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-10 16:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 21:48 [PATCH] bitbake: fetch2/gitsm: avoid live submodule fetching during unpack() Matt Hoosier
2018-05-09 23:27 ` Andre McCurdy
2018-05-10  0:40   ` Matt Hoosier
2018-05-10  1:05     ` Andre McCurdy
2018-05-10 16:34     ` Burton, Ross

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.