From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6498671579909586944 X-Received: by 10.28.54.90 with SMTP id d87mr239976wma.19.1513090185033; Tue, 12 Dec 2017 06:49:45 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.232.150 with SMTP id f22ls2252889wmi.8.gmail; Tue, 12 Dec 2017 06:49:44 -0800 (PST) X-Google-Smtp-Source: ACJfBotvsAHveEmg/KnBzexJUelq7Il08ydyJhz1NOA94pseAhqBgUmL1GRHz2zMDLPjUkAbUW3/ X-Received: by 10.223.176.8 with SMTP id f8mr466321wra.28.1513090184547; Tue, 12 Dec 2017 06:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513090184; cv=none; d=google.com; s=arc-20160816; b=OZYgylGkybfSLv2QPCnV2cpHp8QSUasHLPQsO5ITjECpKmAQPxSdeIfaYUevkCYJya GuikQvr/Hj07DtJ1LF1wKEjbIrI/wY6BwsCzrNrVlzt3uUovFGF9MJAYjz/+kh4l5X25 6A/ordsKs/ivQMLkzaAdVHrEp3JWOWHvo+Mn+6EnHVDieNkuO+FZ5gAACP3ZMVdxGsK0 NdAPiVqiF7edvTADCLqUZZXO6d7EPYvnnstL5pWz1NlGgNJOR4qdhQXt4hpe3BpD9r/+ 5u2DXYmXXll0ZwrimSWJwOmHbs17y+QIqEpIAIsYgfWdxx562I3TMswcg+xlbDjTWhky dPHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=rImk04D6UWhsYFLMb5jB5f5TMNLZiz2fvb2ysN2X8CQ=; b=wEdWFICgWwgRXOQeo/RyTqoqTP/A2NOp8wR+0sQTWHph7UgmZWqHJwMMW6/KQ7vdSM 2xtTxr94HTISJNwRvlILTxZfvQvNHlbTTbN6ySfM/QZFNa6uCA9rntb0tgJVhLeE4HGC VGPu/GzJldBw/Z/4Qmd3j+vIQTXkXFz6KSNXj6oG2y0RSywX7kCds3GnnXUsw2wEfOHW 6ae5iCeXViFhuQyx14TgM+fApcTHjFf2aVCmlbQgfISoElp8gkflxShti9zR/K9mwe4I bkf9Y5QUT1J2zuS0iEi1WDuHEl6Z19mmT5O66itw+eu6QarVaXUC/ip0raQcjpxBJBDt 36gQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id h76si540986wmd.1.2017.12.12.06.49.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 06:49:44 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id vBCEni1V031076 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2017 15:49:44 +0100 Received: from mmd1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id vBCEnhEi023352; Tue, 12 Dec 2017 15:49:43 +0100 Date: Tue, 12 Dec 2017 15:49:43 +0100 From: Henning Schild To: Cc: Subject: Re: [PATCH] fetch/git: add support for disabling shared clones on unpack Message-ID: <20171212154943.55b0e2eb@mmd1pvb1c.ad001.siemens.net> In-Reply-To: <20171212144443.30618-1-henning.schild@siemens.com> References: <20171212144443.30618-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: sWQwgLfxOl1s We actually ran into that issue on a build system called Isar. https://github.com/ilbers/isar This build system executes some tasks in a chroot. In this chroot a "shared" clone will not work because it expects its "alternate" to be at the very same location it was outside the chroot. We considered several hacks in Isar - patching the alternates before and after chroot - mounting the "alternate" to the exact location in chroot None of this is really nice, so we decided to try and do something about it upstream. regards, Henning Am Tue, 12 Dec 2017 15:44:43 +0100 schrieb Henning Schild : > 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. > > Signed-off-by: Henning Schild > --- > 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..30b88c83 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" > + cloneflags = "-n" > + if not ud.noshared: > + cloneflags += " -s" > if ud.bareclone: > ud.cloneflags += " --mirror" >