From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6464921707679318016 X-Received: by 10.46.80.25 with SMTP id e25mr1451552ljb.10.1505310078463; Wed, 13 Sep 2017 06:41:18 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.206.200 with SMTP id e191ls945084wmg.2.canary-gmail; Wed, 13 Sep 2017 06:41:18 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4519IeDm4YO2a4ogpalEU9RQiiw6BoZYkHkIiIkfevwm7vlc88vk+Ekce4j4FSdjB2iap7 X-Received: by 10.223.172.196 with SMTP id o62mr1124863wrc.10.1505310078159; Wed, 13 Sep 2017 06:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505310078; cv=none; d=google.com; s=arc-20160816; b=paGbD9JdXh7drkDKBsDMC5LMlJnD8GYz+w7w0J4mRd4nFY6fevJ4Mo5tKogunohQgI LrZIIPXKlpZg6vZWeRJLJe/drvTL1YLfOagGvv1+isG+enkeOK0iXYYddZfXsbblTP08 2yljXilpAbFG1tcYXLPD9Isiqlq5//v1gCQrJ5pehdT3w030H1UkK3VGjuOrwIRnYHIR YI0aRz7+F4bNQajAKQAxZi8VZmjNoz6wgpPjfEavwAFW+lOuDvwA+QZEH9uxZ3+oxFTP pe9xW5bXHSKAKuHeYLd9tiwFt6sUfzo4ms+x9D8B2Lh3GWJCCTDWLpY632BatKjhtC+f sPVw== 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=q8nocL2jxalWvXr/Tl7X6v51OrojfVkNo36BA+xBxYk=; b=fuGTJt+j+v0hdoQKRsjTzssqdIznql2HW2JGQlb4g+v2HUUUtfoeIueZO/rOo2oqW/ HfhUMDeJBNUVl26NOq10+cZ86rGUIqTqt6zduB9lwE4FL/S0T6q0YOlRaPHbKQYhNMy0 8x5xt9pqI6HW1CPMckqHNk9MWBIsSgBrnb3WCALetMpwN1m3277FEzWkXpecu1GTCscT 5a+u0ssoscNHqDulR1457eynxdEx887IMdtortF+3cCxe5qRMrZoZpNNqL6sXgialKnE RXYgowIKu6f1337TokHCb9LZjYFaU/hY6dkLCPHIOXaYh7TLMSN+JA23E4ZeRv/erWUd AkzQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id q145si85784wme.4.2017.09.13.06.41.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 06:41:18 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v8DDfHaW011743 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Sep 2017 15:41:17 +0200 Received: from md1em3qc ([139.25.68.40]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v8DDf8r7021269; Wed, 13 Sep 2017 15:41:08 +0200 Date: Wed, 13 Sep 2017 15:41:20 +0200 From: Henning Schild To: Alexander Smirnov Cc: , Claudius Heine Subject: Re: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Message-ID: <20170913154120.1e10131f@md1em3qc> In-Reply-To: References: <20170912155810.9434-1-henning.schild@siemens.com> <20170912155810.9434-4-henning.schild@siemens.com> X-Mailer: Claws Mail 3.13.2 (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: R27uWO2cLhQI Am Wed, 13 Sep 2017 15:44:00 +0300 schrieb Alexander Smirnov : > Hi, > > On 09/12/2017 06:58 PM, Henning Schild wrote: > > Issue: > > The 'do_build' task in dpkg does more than just building, it also > > prepares the build environment and cleans it up after building. > > Other classes building debian packages might need the same steps > > while implementing the actual build step in a different way. > > > > Change: > > Pull the actual building out into a function that gets called from > > 'do_build' between the pre and post stuff. > > > > Impact: > > This patch does not change the behaviour of Isar. It addresses the > > issue and prepares for another patch. > > > > Signed-off-by: Henning Schild > > --- > > meta/classes/dpkg.bbclass | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass > > index abd4cef..5c3c1f8 100644 > > --- a/meta/classes/dpkg.bbclass > > +++ b/meta/classes/dpkg.bbclass > > @@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}" > > do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > > > # Build package from sources using build script > > +dpkg_runbuild() { > > + sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR} > > +} > > That's one of the weak places in Isar (also there are several others > with the same issue). If chroot failed - we will have some folders > mounted. Can we somehow track return value and perform clean-up if > build failed? I found that issue as well. But i decided to ignore it for now, because i did not introduce it. It would be easy to deal with it. i.e. mkdir touch mount do umount rm rmdir would become ret=0 mkdir touch mount do || ret=$? umount rm rmdir return ret Henning > I do not mean to rework this patch, this could be done later. The > question is if it's possible in general with such splitting approach. > > Alex > > > + > > +# Wrap the function dpkg_runbuild with the bind mount for buildroot > > do_build() { > > mkdir -p ${BUILDROOT} > > sudo mount --bind ${WORKDIR} ${BUILDROOT} > > - sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR} > > + dpkg_runbuild > > sudo umount ${BUILDROOT} > > rm -rf ${BUILDROOT} > > } > >