From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6491554293275951104 X-Received: by 10.223.190.11 with SMTP id n11mr463798wrh.2.1513081810747; Tue, 12 Dec 2017 04:30:10 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.120.3 with SMTP id t3ls2256627wmc.5.canary-gmail; Tue, 12 Dec 2017 04:30:10 -0800 (PST) X-Google-Smtp-Source: ACJfBot7rTMshpLFOlX0M5Bov3zHIGe3wCoHGMdA4CWxrAznteD96muDWzczZ2RtfPxGHuXxn6iW X-Received: by 10.223.196.239 with SMTP id o44mr465972wrf.9.1513081810250; Tue, 12 Dec 2017 04:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513081810; cv=none; d=google.com; s=arc-20160816; b=SZe4x14SkXjOsD0iTueflZqb5UHzKAuYXjXvP3uO4fFwfzRl6L3GKAyjwrVA4EpUTp aCwwaYDZNHRBXDSQ7ys1gO2MNK4xVnfprPaW/Sg4J30DXGIR8GoyJSBY23UHq/YHy3Dn PwzrGbpB8n5O9HnnlC3BOIhPCPxVIiV1c+KGYlYocyuWz301mJI+Jnhdd4IH6cslPeMK 3WCw4tFE9jiRU7jOxcDbRECzQFGJ9w1Skj8918V5rV9xzJPclwvYwQd35IQQa+zxFFpi w5fcb9Q5OwpkVxv6TVyFbJeHsaJY+jbO/W7H+yTsZxWkyX+SuJp0OlFNFc50jxe96Gbi V1lQ== 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 :arc-authentication-results; bh=vap8XllK2cNZy74AclVt92XqLB1iWz5mDQK5xEwny+k=; b=IA1gbkZnsonGjqkZW0FX34cpjoiPQr0cpt2z/V82bbu3sECAn9OnlucKWobEq0eSP/ LDXOZWe9uOv2CY72bVgM2WMVCRpbez45k6r8uJsjXZ+RysqQvyG6pngP4X7p/oXQEaVG tl9DCXz4T+BpnZO1OhTuOEJJ2BYgSlRrjzenDIt636Czduib10MYmG1HKpkm+PzcqHVI rSLMzY/QhQvLG6SGqRNyRZsd740TT78ck7KNECL3Z1eFxJETZ8Gv+t6uI6Mf00BRADY4 6FSXLK6d/ogkw61RI7boWq03mbyB1vZHQIlKJ2hi9iCF5tQYrpguggC1mL0uur048mMA h3IQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id m4si2161927wrm.4.2017.12.12.04.30.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 04:30:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] (client.yota.ru [188.162.65.100] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id vBCCU5R8027922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 12 Dec 2017 13:30:08 +0100 Subject: Re: [PATCH v3 4/4] dpkg-base: Update git alternates To: Henning Schild Cc: isar-users@googlegroups.com References: <20171126220025.14168-1-asmirnov@ilbers.de> <20171126220025.14168-5-asmirnov@ilbers.de> <20171211185646.02ca7be5@md1pvb1c> <20171212124936.2329ba8d@md1pvb1c> From: Alexander Smirnov Message-ID: <13a670ad-aabf-0145-57a3-28c38338f970@ilbers.de> Date: Tue, 12 Dec 2017 15:30:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171212124936.2329ba8d@md1pvb1c> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: P18qDLIMxSKZ On 12/12/2017 02:49 PM, Henning Schild wrote: > Am Mon, 11 Dec 2017 22:45:15 +0300 > schrieb Alexander Smirnov : > >> On 12/11/2017 08:56 PM, Henning Schild wrote: >>> Well i thought about this again. This is a very nasty workaround >>> for a problem this actually is in bitbake. >> >> That's an attempt to solve here and now git-3.0 issue reported by >> Christian. So if in general it's not critical problem for now, I >> could drop this series. >> >>> >>> https://github.com/openembedded/bitbake/blob/ebce92bf8d71f8a6e8af1c6cf6ba335faf9d67c8/lib/bb/fetch2/git.py#L179 >>> >>> That problem should be fixed in bitbake, if they accept patches. The >>> "-s" needs to depend on some condition. >>> >> >> I'm not sure that this is the best solution. The main idea of using >> '-s' was to avoid unnecessary copying of git repos within one build, >> it costs disk space and extra time for copying (for example linux.git >> is about 1GB). So usage of '-s' is quite reasonable here. > > I know why it is there, all i am saying it should maybe not be there > unconditionally. We could probably try and fix that upstrem and > introduce BB_GIT_SHARED or a new param "shared". > > And now you could say > BB_GIT_SHARED=0 > SRC_URI=git:// ....git > or > SRC_URI=git:// ....git;shared=0 I like this one, I've already investigated supported parameters for git protocol, there are lot of them. So extra new one should not be a problem :-) > > Let me know what you think about that idea and i will prepare patches. So, if it covers your use case and you could prepare the patch, this would be great :-) Alex > If they get merged we could cherry-pick them into Isar and forget about > the alternate-patching. > > We could also agree that "shared" is an important feature we want in > Isar, in that case the alternates should get patched. And we need an > updated version of the proposed patch. > Thinking about that ... again ;) This is would i would now vote for. > >> Another solution could be deprecate 'downloads' directory and fetch >> gits directly to package WORKDIR. > > I think having the downloads dir might eventually help with the > reproducible builds. > >> >>> For Isar i would tell people to fetch tarballs from git servers and >>> avoid git://. >> >> This should not be the requirement, because it limits Isar >> application area. Not all git repo could be fetched as tarball. > > Agreed, i am just talking about temporary workarounds until we have a > solution. Fetching with git is something that, to me, does not sound > like a high prio feature. > > Henning > >> Alex >> >>> >>> Henning >>> >>> Am Mon, 27 Nov 2017 01:00:25 +0300 >>> schrieb Alexander Smirnov : >>> >>>> Update git alternates to work in buildchroot. >>>> >>>> Signed-off-by: Alexander Smirnov >>>> --- >>>> meta/classes/dpkg-base.bbclass | 12 ++++++++++++ >>>> 1 file changed, 12 insertions(+) >>>> >>>> diff --git a/meta/classes/dpkg-base.bbclass >>>> b/meta/classes/dpkg-base.bbclass index 5d7f8b6..6a78a26 100644 >>>> --- a/meta/classes/dpkg-base.bbclass >>>> +++ b/meta/classes/dpkg-base.bbclass >>>> @@ -18,12 +18,24 @@ dpkg_runbuild() { >>>> >>>> # Wrap the function dpkg_runbuild with the bind mount for >>>> buildroot do_build() { >>>> + if [ -d ${WORKDIR}/git/.git ]; then >>>> + OBJ_PATH=$(cat >>>> ${WORKDIR}/git/.git/objects/info/alternates) >>>> + REPO_PATH=$(dirname $OBJ_PATH) >>>> + REPO_NAME=$(basename $REPO_PATH) >>>> + echo "/git/$REPO_NAME/objects" > >>>> ${WORKDIR}/git/.git/objects/info/alternates >>>> + fi >>>> + >>>> mkdir -p ${BUILDROOT} >>>> sudo mount --bind ${WORKDIR} ${BUILDROOT} >>>> _do_build_cleanup() { >>>> ret=$? >>>> sudo umount ${BUILDROOT} 2>/dev/null || true >>>> sudo rmdir ${BUILDROOT} 2>/dev/null || true >>>> + >>>> + if [ -d ${WORKDIR}/git/.git ]; then >>>> + echo $OBJ_PATH > >>>> ${WORKDIR}/git/.git/objects/info/alternates >>>> + fi >>>> + >>>> (exit $ret) || sudo umount ${BUILDCHROOT_DIR}/git >>>> (exit $ret) || bb_exit_handler >>>> } >>> >> >