public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "[ext] Henning Schild" <henning.schild@siemens.com>,
	bitbake-devel@lists.openembedded.org
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v2] fetch/git: add support for disabling shared clones on unpack
Date: Mon, 12 Feb 2018 08:40:47 +0100	[thread overview]
Message-ID: <027e7d81-b55a-ce05-9188-c34376a78197@siemens.com> (raw)
In-Reply-To: <20171212151203.31408-1-henning.schild@siemens.com>

On 2017-12-12 16:12, [ext] Henning Schild wrote:
> 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. Probably something that hardly anyone would want to do.
> 
> 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.

s/existant/existent/

> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  lib/bb/fetch2/git.py | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 5ef8cd69..7b7f02b2 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -53,6 +53,13 @@ Supported SRC_URI options are:
>     For local git:// urls to use the current branch HEAD as the revision for use with
>     AUTOREV. Implies nobranch.
>  
> +- noshared
> +   When unpacking do not clone with the parameter "--shared". This option will
> +   allow the unpacked copy to work stand-alone i.e. if your recipe runs in a
> +   chroot where the "alternate" can not be found. Setting this will increase
> +   the unpack-time and the disk-usage.
> +   The default is "0", set noshared=1 if needed.
> +
>  """
>  
>  #Copyright (C) 2005 Richard Purdie
> @@ -159,6 +166,8 @@ class Git(FetchMethod):
>  
>          ud.nobranch = ud.parm.get("nobranch","0") == "1"
>  
> +        ud.noshared = ud.parm.get("noshared","0") == "1"
> +
>          # usehead implies nobranch
>          ud.usehead = ud.parm.get("usehead","0") == "1"
>          if ud.usehead:
> @@ -176,7 +185,9 @@ 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.cloneflags = "-n"
> +        if not ud.noshared:
> +            ud.cloneflags += " -s"
>          if ud.bareclone:
>              ud.cloneflags += " --mirror"
>  
> 

Ping on this feature: Could we get some feedback if/how such a
configuration option would be acceptable for upstream? We'd like to
avoid having to patch or fork bitbake downstream for such a tiny change.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2018-02-12  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 14:44 [PATCH] " Henning Schild
2017-12-12 14:49 ` Henning Schild
2017-12-12 15:01 ` Henning Schild
2017-12-12 15:12 ` [PATCH v2] " Henning Schild
2018-02-12  7:40   ` Jan Kiszka [this message]
2017-12-12 15:14 ` [PATCH] " Henning Schild

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=027e7d81-b55a-ce05-9188-c34376a78197@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox