From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6498671579909586944 X-Received: by 2002:a05:6402:c8:: with SMTP id i8mr30354830edu.57.1618240361300; Mon, 12 Apr 2021 08:12:41 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:907:c24:: with SMTP id ga36ls1457007ejc.9.gmail; Mon, 12 Apr 2021 08:12:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8M62WW3W/zj9rtnlCjeYmRvTI39flGLC7aDHljt4JjGaX0kLFP5Mkiv0iHwHVfPGw9nV2 X-Received: by 2002:a17:906:8144:: with SMTP id z4mr11579753ejw.404.1618240360321; Mon, 12 Apr 2021 08:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618240360; cv=none; d=google.com; s=arc-20160816; b=o4bG19UMdWTafbAifH3l7uNAzwF9im0Mb4md6jsGB/rBzF9H0SORBKRiBiF3PBeTEM 0zSYN9xTjA0kg5B0b65hpjtrzQPdDcmK6G2f1itYHYhwiyd5d+jA1qIPojqMNipzLyRq 1U9D0izDDHWv6ijJmAk6mcF5Z+h716dwqyK7wtKJYNytd2vDMNXEjcb1m7SY/cXFNnN5 dpSORUbpOh3jhma/rAs9joFMuowIcntGkpw67tg653lHGMOJZNd6zS+6guuc35r2LOF/ JXzT3w6U9Woi5UStjpUrtf5TpnOQlecNb1VWLavXQ0oO7CZN8o9jFc4MRY5UVhTDMjc2 izTQ== 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; bh=+b/f26aIDHBZyEUUOwoy+/d110bLfeQs14GP7+P8X8E=; b=lCeWWz8N44zJQok7Z3qn+N0NWJqdlW3UCRWwuwTTTMwDtuHP9j3HtT+hrUznpmfbIX 9gsreNzhhtLJZH6I1x55LB5r30MxgQPTbw7CcuJ5g9YNC53mTYiD/XyIQyFnKoxuF/4r sNmUCRL3IY94QnSb1Fqrrx0/u/FNKNtr/k/2r4hT3+WOgb8ssHeRg1x+Ag27BVvOMmKx MCHnsHPgK4R96RSfHhYIm3M3XetZg1hZwizIkCODvfSugyOX5uLrncOhAuV8gzhigxSL d90Wcfz+tkPkhUzG4reK5QaVD3m8Rb+Pa+XWiZ2TvGxQit3rWF+j74nWGVgga/ft7s1q MCJg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id y16si1038780edq.2.2021.04.12.08.12.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Apr 2021 08:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 13CFCdvl009582 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Apr 2021 17:12:39 +0200 Received: from md1za8fc.ad001.siemens.net ([139.22.41.180]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 13CF5KQO004576; Mon, 12 Apr 2021 17:05:20 +0200 Date: Mon, 12 Apr 2021 17:05:19 +0200 From: Henning Schild To: , Richard Purdie Cc: Subject: Re: [bitbake-devel] [PATCH] fetch/git: add support for disabling shared clones on unpack Message-ID: <20210412170519.53612c01@md1za8fc.ad001.siemens.net> In-Reply-To: <20180130131805.4725ccf3@mmd1pvb1c.ad001.siemens.net> References: <20171220164209.9609-1-henning.schild@siemens.com> <20171220174538.441d517f@mmd1pvb1c.ad001.siemens.net> <20180130131805.4725ccf3@mmd1pvb1c.ad001.siemens.net> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: y0NxZHx0zfEx Hey, this is still pretty much relevant to Isar, where an unpack with git goes into a chroot. Having a way not clone "shared" would really help us in Isar. Any comments? Except for this one maybe not applying anymore, did not try. regards, Henning Am Tue, 30 Jan 2018 13:18:05 +0100 schrieb "[ext] Henning Schild" : > Bump! Could i please get a review on this patch? > > regards, > Henning > > Am Wed, 20 Dec 2017 17:45:38 +0100 > schrieb Henning Schild : > > > 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 Wed, 20 Dec 2017 17:42:09 +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..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" > > > > > >