From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6488313435861811200 X-Received: by 10.28.189.85 with SMTP id n82mr176788wmf.23.1510938388696; Fri, 17 Nov 2017 09:06:28 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.21.85 with SMTP id 82ls1010343wmv.0.canary-gmail; Fri, 17 Nov 2017 09:06:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMbQFQi5K48csQwsmBHpfr5zkokHDH9EhqEnxcXOJdN6uZF8rEepE1+0nABl4EreoHZ3dv/U X-Received: by 10.28.141.149 with SMTP id p143mr627971wmd.13.1510938388467; Fri, 17 Nov 2017 09:06:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510938388; cv=none; d=google.com; s=arc-20160816; b=tRNTBl8AHzI/1QClfJUJ1OQGb8lkWSOcKHaX1szrQN8fYmI2VANOEbQ+WcT/RpOpas DGwtLyDwt8hokHdN53NQ8Alcu2WsFtacrUTiC91Ni0kwZjGKPAs0STkajhQ0UcCg1LZ9 KDnMqftktqzJfMcbDAGrjQ0JI+glG5O7RfHapr7VUinNehsrXIL3R5NmZCZ4YIRhscvu ou7G6eg9qwfI+BFOTu1hcIUMM6cTqyR5IAPeB5+v/ue/ag8YSUYpg1PlYk0YcSyNxXfX ahII10rC3OXZV7IZe8N1q/pf+gAfPJvtl9O6PdsPK8ZSkGv4Ij6oAhd5mrH+t16OzZvY nNQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:mail-followup-to:message-id :subject:to:from:date:arc-authentication-results; bh=asEQIBAwb3cmDbNiI9q5RhlD9gI6SMRO1ZMj5szjRSk=; b=ldFOJAjeAHmbPLynQSL6YLuz+j/jj5SGOTdw8pWqERC1FTgNfJFlSFDuvHTXuv6ks/ KGSOZkO3KzI6f0nqrqmnaUjJ7N+HQiRSLlXrh/h6cCvVRVN+ROc7rUJaJCaFj6IckaOB V6gmbiCsNEBgdI5mCSmuw2lPnyDwXbtBxzuK3w0ZHekYqii1Ee04jVmC9aNwxD/1fsQ1 Y9RLT88bT51K3QXPzcavcMc7qddSc2a6dUJNzYJe77G6iiIuA89QExucspvIOlvUgC1g Artrqu8AlfW/PbxtHGkV0x+OwsSHS5Rh3w5zNz9BpDD9p8HKDTNVDPB9v5xZstHM2JFW o8DA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id f8si355910wrf.0.2017.11.17.09.06.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 09:06:28 -0800 (PST) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id vAHH6Snv005245 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 17 Nov 2017 18:06:28 +0100 Received: from localhost ([139.25.69.251]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTPS id vAHH6RGO015948 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 17 Nov 2017 18:06:27 +0100 Date: Fri, 17 Nov 2017 18:05:12 +0100 From: Christian Storm To: isar-users@googlegroups.com Subject: Re: [PATCH] dpkg-base: mount git source folder into buildchroot Message-ID: <20171117170512.t7qqymvsrh5gf2e6@MD1KR9XC.ww002.siemens.net> Mail-Followup-To: isar-users@googlegroups.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <185f0c4a-d1a9-159c-9852-272c92415615@ilbers.de> User-Agent: Mutt/20170113 (1.7.2) X-TUID: SiFrF/bQ4cL7 > > When building a Debian source package with source/format "3.0 (git)", > > the git binary is used to bundle the source. For being able to do so, > > /tmp/downloads/git/ needs to be mounted into the > > buildchroot as .git/objects/info/alternates refers to it. > > Could you please provide more details regarding where it should be mounted? Please see below for an explanation. > > Signed-off-by: Christian Storm > > --- > > meta/classes/dpkg-base.bbclass | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass > > index 35af6d5..a98e690 100644 > > --- a/meta/classes/dpkg-base.bbclass > > +++ b/meta/classes/dpkg-base.bbclass > > @@ -20,14 +20,18 @@ dpkg_runbuild() { > > # Wrap the function dpkg_runbuild with the bind mount for buildroot > > do_build() { > > mkdir -p ${BUILDROOT} > > - sudo mount --bind ${WORKDIR} ${BUILDROOT} > > + [ ! -d ${BUILDCHROOT_DIR}/${GITDIR} ] && sudo install -d -m 755 ${BUILDCHROOT_DIR}/${GITDIR} > > ${GITDIR} - will be expanded to absolute path of your build tree on the > host. Why this private path is needed in buildchroot? This doesn't look > correct for me if you need it for build. > > Also git repository is already available in buildchroot: > > 1. If package is fetched via git repository - it's stored in ${GITDIR}. > 2. Then task "do_unpack" clones this to ${WORKDIR}/git folder > 3. During build task, the folder ${WORKDIR} is mounted to ${BUILDROOT} > 4. So your git repo is in: /home/builder/${PN}/git folder inside chroot. Well, no. It contains the checkout of the source done by the fetcher. You'll get a castrated .git/ in the buildchroot, i.e., try to run git operations in the buildchroot when do_build'ing a particular package and git complains: error: object directory /build/tmp/downloads/git/xxxxxx/objects does not exist; check .git/objects/info/alternates. fatal: bad object HEAD It tries to resolve the repository "symlink" in .git/objects/info/alternates which points to the directory the fetcher has put it in, i.e., /tmp/downloads/git/xxxxxx. This directory, respectively, /tmp/downloads/git/, however, isn't mounted in the buildchroot and so git can't do operations. Hence, source/format "3.0 (git)" fails as it wants to do git operations. Does this explanation help? Kind regards, Christian -- Dr. Christian Storm Siemens AG, Corporate Technology, CT RDA ITP SES-DE Otto-Hahn-Ring 6, 81739 M�nchen, Germany