From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6995471841453146112 X-Received: by 2002:a05:6402:40c9:: with SMTP id z9mr21848550edb.159.1629133057204; Mon, 16 Aug 2021 09:57:37 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:907:d1f:: with SMTP id gn31ls3993223ejc.11.gmail; Mon, 16 Aug 2021 09:57:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvDSNkD77TeRUilAz5AbviwPTbEMJlh4xIq/0eTxyb1jPWXr400k4+aSUCcTLN7MLVWEcH X-Received: by 2002:a17:906:ec9:: with SMTP id u9mr16758405eji.243.1629133056027; Mon, 16 Aug 2021 09:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629133056; cv=none; d=google.com; s=arc-20160816; b=WqdJfrxCObxvuSfus3rZgNlNSGlatfJpURhP47SVh4xh2gRAT3BguXJortsefoHibd OxCoE7AicUrx/r8J6DoSBy6ASxTsTXNwzjLbv/IDSc4pvs+BhTKHD02KMaxb/L9Oxi6Z cDT0yK/AuduDInGWta+GBA++gFT44chzRH6WDTzYfLapzc1GLnPKSWvsYvfWAlIWdkZx 6CfG/y+KyNw8zg/cN2gpWna1cTbCGGgdKVeK4gs4jIVJBgVCHxbvFI9+0YJp0+OKqdM2 H+FWObm6MVvEYBBpQFc+ul95V4XrioFwYMP+GmzVw7Ny0YosvuDx/Kyb6nXgKfk92vqw 3+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=IFqo2VjJqORAg3/mFzabuBCNa9BAWAEosp0hNwtbFdk=; b=qB7vNeaqNE9T4nkLpwNoRAAQKtHrxKkAOV79mta/SvNVxVqjo8Ax/WtjnSPiclyT5Q wRjxCghS0n/VmWo7Yw/3YjK4LgMXanx18bXeNkgfrvrMjGgFh6u4z/i9fXw8IlhJYpg2 1yNcCPNSPsqgyBRDbNsRoA7EWjR07MDLLORyo1aya4FxN8b8pTyUMn7kKUX+VUHJ8VO8 RN07quDV0omvfpNEHbQnKMTMxUzGKFIAGUpiZ3l1z6GCdtj+fibU6tsx9m8JSBhUa8Mf AB5sNko1LTyj/ybuZnkEV66h2xEfcujXWvfiQn9mAI2LYRMJ4HqX0cJ0wH+os4CmJUxG JOjQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id u25si499972edd.1.2021.08.16.09.57.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Aug 2021 09:57:36 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 17GGvZtT005377 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 16 Aug 2021 18:57:35 +0200 Received: from [167.87.0.29] ([167.87.0.29]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 17GGvZmr027918; Mon, 16 Aug 2021 18:57:35 +0200 Subject: Re: [PATCH] dpkg-base: "unshare" git clones in adjust_git To: Henning Schild Cc: isar-users References: <20210813160434.16eb4198@md1za8fc.ad001.siemens.net> <20210813174944.8833-1-henning.schild@siemens.com> <20210816133606.36949c9c@md1za8fc.ad001.siemens.net> From: Jan Kiszka Message-ID: <9cee9b1c-09d6-0c96-b8c3-52c171177da1@siemens.com> Date: Mon, 16 Aug 2021 18:57:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210816133606.36949c9c@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: UDAFy3QGLcHV On 16.08.21 13:36, Henning Schild wrote: > Am Sun, 15 Aug 2021 20:55:34 +0200 > schrieb Jan Kiszka : > >> On 13.08.21 19:49, Henning Schild wrote: >>> Instead of messing with the alternate make the clone not "shared" >>> anymore. Doing that will allow us to use git as a patchtool, also in >>> incremental rebuilds where do_patch might run again after >>> do_adjust_git >>> >>> It will also make sure git repos will be usable in all three >>> environments. On a container host, inside the container, and inside >>> the chroot ... as apposed to only the chroot in the end. >>> >>> Signed-off-by: Henning Schild >>> --- >>> meta/classes/dpkg-base.bbclass | 7 +++---- >>> 1 file changed, 3 insertions(+), 4 deletions(-) >>> >>> diff --git a/meta/classes/dpkg-base.bbclass >>> b/meta/classes/dpkg-base.bbclass index ec8fbc14d5e4..2a8e3ef4b817 >>> 100644 --- a/meta/classes/dpkg-base.bbclass >>> +++ b/meta/classes/dpkg-base.bbclass >>> @@ -45,11 +45,11 @@ python do_adjust_git() { >>> alternates = os.path.join(destdir, >>> ".git/objects/info/alternates") >>> if os.path.exists(alternates): >>> - cmd = ["sed", "-i", alternates, "-e", >>> - >>> "s|{}|/downloads|".format(d.getVar("DL_DIR"))] >>> + cmd = ["git", "-C", destdir, "repack", "-a" ] >>> bb.note(' '.join(cmd)) >>> if subprocess.call(cmd) != 0: >>> - bb.fatal("git alternates adjustment failed") >>> + bb.fatal("git repack failed") >>> + os.remove(alternates) >>> except bb.fetch2.BBFetchException as e: >>> bb.fatal(str(e)) >>> } >>> @@ -57,7 +57,6 @@ python do_adjust_git() { >>> addtask adjust_git before do_dpkg_build >>> >>> inherit patch >>> -addtask patch before do_adjust_git >>> >>> SRC_APT ?= "" >>> >>> >> >> NACK, we have a pattern now that avoids this. > > Does that cover all three envs? (docker-host, docker, and chroots?) > You are welcome to test. I've completed all tests successfully so far. Note that it does not resolve the kas-container specific issue (nor does your patch) that the download dir is generally different inside and outside of the container. But kas-container shell is happy now. > If your ../../../.. thing works that might be fine, but this whole > approach with "sed" is git surgery not backed by documentation or > official interfaces. > The benefit of the deduplication is likely neglectible ... unless you > take the kernel as example. But even there you are probably saving much > more with going shallow than with deduplication via shared clones. > Given the significant drawbacks of deduplications and - so far - no known remaining limitations of the relative alternate path, there is no reason for add this patch. Also note that your patch leaves the mirror link issue unresolved. That sails under "adjust_git" but is not about patching alternates. Therefore: NACK for this path. Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux