From: Henning Schild <henning.schild@siemens.com>
To: <isar-users@googlegroups.com>
Cc: <bitbake-devel@lists.openembedded.org>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
Cedric Hombourger <Cedric_Hombourger@mentor.com>,
Chris Larson <Chris_Larson@mentor.com>
Subject: Re: [PATCH v3 1/3] fetch/git: add support for disabling shared clones on unpack
Date: Tue, 27 Apr 2021 18:53:00 +0200 [thread overview]
Message-ID: <20210427185300.5f4357ea@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20210414063241.18528-1-henning.schild@siemens.com>
Note mainly to isar-users, this is now merged in upstream bitbake. Once
we update our bitbake we can set "BB_GIT_NOSHARED = 1" in our
bitbake.conf and drop the git adjust task. That should allow use of git
outside the chroot and hopefully does not have a too negative impact on
unpack performance ... for big things like the kernel
Henning
Am Wed, 14 Apr 2021 08:32:39 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> By default the unpacker will create a "shared" clone when cloning from
> the DL_DIR to the WORKDIR. This patch introduces an option to control
> that behaviour.
>
> Imagine some recipe steps are executed in a namespace that is
> different from the one your downloader and unpacker ran in. (chroot)
> Because a "shared" clone has an absolute reference to its "alternate"
> you now have to make that "alternate" visible in that new namespace
> (chroot) at the exact place.
>
> With this patch you can unpack "noshared" and get a stand-alone copy.
> This copy will also work if the "alternate" is not visible or
> existant.
>
> The switch is a global bitbake switch and will affect all git urls.
> Build systems that need "noshared" most likely need it for everything
> they do with git.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> lib/bb/fetch2/git.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index e3ba80a3f52a..3e25b4b6047c 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -168,7 +168,11 @@ class Git(FetchMethod):
> if len(branches) != len(ud.names):
> raise bb.fetch2.ParameterError("The number of name and
> branch parameters is not balanced", ud.url)
> - ud.cloneflags = "-s -n"
> + ud.noshared = d.getVar("BB_GIT_NOSHARED") == "1"
> +
> + ud.cloneflags = "-n"
> + if not ud.noshared:
> + ud.cloneflags += " -s"
> if ud.bareclone:
> ud.cloneflags += " --mirror"
>
prev parent reply other threads:[~2021-04-27 16:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 6:32 Henning Schild
2021-04-14 6:32 ` [PATCH v3 2/3] tests/fetch: deduplicate local git testing code Henning Schild
2021-04-14 6:32 ` [PATCH v3 3/3] tests/fetch: add tests for local and remote "noshared" git fetching Henning Schild
2021-04-27 16:53 ` Henning Schild [this message]
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=20210427185300.5f4357ea@md1za8fc.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=Cedric_Hombourger@mentor.com \
--cc=Chris_Larson@mentor.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=isar-users@googlegroups.com \
--cc=richard.purdie@linuxfoundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox