[bitbake-devel] [PATCH v2 2/2] gitsm.py: support BB_NO_NETWORK during do_unpack

Mikko.Rapeli at bmw.de Mikko.Rapeli at bmw.de
Wed Sep 6 16:16:02 UTC 2017

On Wed, Sep 06, 2017 at 10:53:04AM -0500, Mark Hatle wrote:
> On 9/6/17 10:47 AM, Mikko.Rapeli at bmw.de wrote:
> > On Wed, Sep 06, 2017 at 08:24:14AM -0700, Christopher Larson wrote:
> >> On Wed, Sep 6, 2017 at 5:33 AM, Mikko Rapeli <mikko.rapeli at bmw.de> wrote:
> >>
> >>> 'git submodule update --init -recursive' will clone remote repositories
> >>> if local tree does not have the referenced commits. Add --no-fetch
> >>> to git submodule update if BB_NO_NETWORK is defined and only local
> >>> download caches should be used.
> >>>
> >>> Signed-off-by: Mikko Rapeli <mikko.rapeli at bmw.de>
> >>>
> >>
> >> If we’re unpacking, there’s no reason to be contacting anything remote
> >> regardless of the value of BB_NO_NETWORK. We should be passing —no-fetch
> >> all the time. We also need to be running a submodule sync to update any
> >> changes urls in the submodule remotes, but there are other issues to be
> >> resolved beyond that.
> > 
> > Yes, I thought about this but decided not to change current behavior.
> > Should have mentioned that in the commit message.
> > 
> > I can send a new version where --no-fetch is the default but it might break
> > in some setups, especially when the DL_DIR cache is not used for submodules...
> (without truely understanding the ramifications), I would prefer the system to
> fail with an error then attempt to contact a network resources if BB_NO_NETWORK
> is set.

Yes, that is clear. The comment from Christopher was about using --no-fetch
by default in do_unpack also for builds with network connectivity.

This could work for fresh clones of the source tree which call download
-> update_submodules -> "git submodule update --init --recursive". Then the
tree would be copied to DL_DIR cache.

A subsequent update to the recipe would extract the repo from DL_DIR and
call unpack which would call only "git submodule update --no-fetch --init

This would work if any recipe changes which update the commit has also call
fetch on the base repo (bitbake/lib/bb/fetch2/git.py ?) and download
from gitsm.py which would call update_submodules ->
"git submodule update --init --recursive".

Did I miss something? Are there some tests for gitsm.py already?

> An error (with a resolution of somehow getting the item local either in the
> DL_DIR or a file:// mirror seems like the best alternative for a user who needs
> to prevent network access.

And this is where the dependency to using DL_DIR cache for git submodules
and first patch in the series becomes into play...


More information about the bitbake-devel mailing list