From: Claudius Heine <ch@denx.de>
To: Henning Schild <henning.schild@siemens.com>,
Alexander Smirnov <asmirnov@ilbers.de>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build'
Date: Wed, 13 Sep 2017 16:40:50 +0200 [thread overview]
Message-ID: <55f37287-c7b7-7e8a-1319-50906a9e146b@denx.de> (raw)
In-Reply-To: <20170913154120.1e10131f@md1em3qc>
[-- Attachment #1.1: Type: text/plain, Size: 2562 bytes --]
Hi,
On 13.09.2017 15:41, Henning Schild wrote:
> Am Wed, 13 Sep 2017 15:44:00 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>
>> 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 <henning.schild@siemens.com>
>>> ---
>>> 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
Another solution might be to look into events and write some cleanup
code there [1].
Cheers,
Claudius
[1]
https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#events
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de
PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
Keyserver: hkp://pool.sks-keyservers.net
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-09-13 14:40 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
2017-09-12 15:58 ` [PATCH v2 1/6] meta: Move 'do_fetch' and 'do_unpack' to base-class Henning Schild
2017-09-12 15:58 ` [PATCH v2 2/6] meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass Henning Schild
2017-09-12 15:58 ` [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Henning Schild
2017-09-13 12:44 ` Alexander Smirnov
2017-09-13 13:41 ` Henning Schild
2017-09-13 14:40 ` Claudius Heine [this message]
2017-09-13 15:27 ` Henning Schild
2017-09-12 15:58 ` [PATCH v2 4/6] meta/dpkg: Move 'do_build' and buildchroot stuff to dpkg-base.bbclass Henning Schild
2017-09-12 15:58 ` [PATCH v2 5/6] meta/dpkg: add dpkg-raw class Henning Schild
2017-09-12 15:58 ` [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Henning Schild
2017-09-13 11:39 ` Andreas Reichel
2017-09-14 7:28 ` Alexander Smirnov
2017-09-14 8:11 ` Henning Schild
2017-09-13 13:13 ` Alexander Smirnov
2017-09-13 14:15 ` Henning Schild
2017-09-13 15:06 ` Alexander Smirnov
2017-09-13 15:28 ` Henning Schild
2017-09-13 15:38 ` Alexander Smirnov
2017-09-14 8:33 ` Henning Schild
2017-09-12 17:07 ` [PATCH v2 0/6] v4 of the custom debian package Henning Schild
2017-09-13 15:00 ` [PATCH][FYI] dpkg-raw: Allow multiconfig build Alexander Smirnov
2017-09-13 15:09 ` Alexander Smirnov
2017-09-14 8:31 ` Henning Schild
2017-09-14 17:18 ` [PATCH v2 0/6] v4 of the custom debian package Alexander Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55f37287-c7b7-7e8a-1319-50906a9e146b@denx.de \
--to=ch@denx.de \
--cc=asmirnov@ilbers.de \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox