* [PATCH] dpkg.bbclass: add lockfile for do_build
@ 2018-01-10 16:04 Christopher Larson
2018-01-11 10:31 ` Alexander Smirnov
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Larson @ 2018-01-10 16:04 UTC (permalink / raw)
To: isar-users
All recipes using this class will run build.sh in the same chroot, and
build.sh runs apt-get to install deps, so the build can fail due to dpkg
being unable to acquire its lock. Add a bitbake lockfile to ensure that
only one do_build task for recipes inheriting this class runs at a time.
Signed-off-by: Christopher Larson <kergoth@gmail.com>
---
meta/classes/dpkg.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index c10f5ba..3966a71 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -7,3 +7,4 @@ inherit dpkg-base
dpkg_runbuild() {
sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
}
+do_build[lockfiles] += "${TMPDIR}/dpkg.lock"
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dpkg.bbclass: add lockfile for do_build
2018-01-10 16:04 [PATCH] dpkg.bbclass: add lockfile for do_build Christopher Larson
@ 2018-01-11 10:31 ` Alexander Smirnov
2018-01-11 12:14 ` Henning Schild
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Smirnov @ 2018-01-11 10:31 UTC (permalink / raw)
To: Christopher Larson, isar-users
Hello Christopher,
thank you for this catch!
On 01/10/2018 07:04 PM, Christopher Larson wrote:
> All recipes using this class will run build.sh in the same chroot, and
> build.sh runs apt-get to install deps, so the build can fail due to dpkg
> being unable to acquire its lock. Add a bitbake lockfile to ensure that
> only one do_build task for recipes inheriting this class runs at a time.
>
Serialization of do_build tasks leads to whole Isar serialization, what
is significant issue if you have lots of packages to build. So I think
the "build" and "deps installation" should be split in separate tasks
and only the second one should be protected by locks.
Alex
> Signed-off-by: Christopher Larson <kergoth@gmail.com>
> ---
> meta/classes/dpkg.bbclass | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> index c10f5ba..3966a71 100644
> --- a/meta/classes/dpkg.bbclass
> +++ b/meta/classes/dpkg.bbclass
> @@ -7,3 +7,4 @@ inherit dpkg-base
> dpkg_runbuild() {
> sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> }
> +do_build[lockfiles] += "${TMPDIR}/dpkg.lock"
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dpkg.bbclass: add lockfile for do_build
2018-01-11 10:31 ` Alexander Smirnov
@ 2018-01-11 12:14 ` Henning Schild
2018-01-11 15:20 ` Christopher Larson
0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2018-01-11 12:14 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: Christopher Larson, isar-users
Am Thu, 11 Jan 2018 13:31:45 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> Hello Christopher,
>
> thank you for this catch!
>
> On 01/10/2018 07:04 PM, Christopher Larson wrote:
> > All recipes using this class will run build.sh in the same chroot,
> > and build.sh runs apt-get to install deps, so the build can fail
> > due to dpkg being unable to acquire its lock. Add a bitbake
> > lockfile to ensure that only one do_build task for recipes
> > inheriting this class runs at a time.
>
> Serialization of do_build tasks leads to whole Isar serialization,
> what is significant issue if you have lots of packages to build. So I
> think the "build" and "deps installation" should be split in separate
> tasks and only the second one should be protected by locks.
The fact that Isar uses multiconfig to build many targets from the same
tree is not intuitive, we discussed this before. So i am not surprised
new contributors get that "wrong". Alex i suggest you split the task
and adopt Christophers changes.
Christopher, have a look at scripts/ci_build.sh and you will see that
Isar is capable of building multiple images at once in the same tree.
If you are building 10 images you will have 10 buildchroots that have
to be serialized seperately. A feature that probably nobody but the
CI-bot will ever use ;).
Henning
> Alex
>
> > Signed-off-by: Christopher Larson <kergoth@gmail.com>
> > ---
> > meta/classes/dpkg.bbclass | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> > index c10f5ba..3966a71 100644
> > --- a/meta/classes/dpkg.bbclass
> > +++ b/meta/classes/dpkg.bbclass
> > @@ -7,3 +7,4 @@ inherit dpkg-base
> > dpkg_runbuild() {
> > sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> > }
> > +do_build[lockfiles] += "${TMPDIR}/dpkg.lock"
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dpkg.bbclass: add lockfile for do_build
2018-01-11 12:14 ` Henning Schild
@ 2018-01-11 15:20 ` Christopher Larson
2018-01-11 17:20 ` Henning Schild
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Larson @ 2018-01-11 15:20 UTC (permalink / raw)
To: Henning Schild; +Cc: Alexander Smirnov, isar-users
[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]
On Thu, Jan 11, 2018 at 5:14 AM, Henning Schild <henning.schild@siemens.com>
wrote:
> Am Thu, 11 Jan 2018 13:31:45 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>
> > Hello Christopher,
> >
> > thank you for this catch!
> >
> > On 01/10/2018 07:04 PM, Christopher Larson wrote:
> > > All recipes using this class will run build.sh in the same chroot,
> > > and build.sh runs apt-get to install deps, so the build can fail
> > > due to dpkg being unable to acquire its lock. Add a bitbake
> > > lockfile to ensure that only one do_build task for recipes
> > > inheriting this class runs at a time.
> >
> > Serialization of do_build tasks leads to whole Isar serialization,
> > what is significant issue if you have lots of packages to build. So I
> > think the "build" and "deps installation" should be split in separate
> > tasks and only the second one should be protected by locks.
>
> The fact that Isar uses multiconfig to build many targets from the same
> tree is not intuitive, we discussed this before. So i am not surprised
> new contributors get that "wrong". Alex i suggest you split the task
> and adopt Christophers changes.
>
> Christopher, have a look at scripts/ci_build.sh and you will see that
> Isar is capable of building multiple images at once in the same tree.
> If you are building 10 images you will have 10 buildchroots that have
> to be serialized seperately. A feature that probably nobody but the
> CI-bot will ever use ;).
Fair enough, thanks, I’ll re-test with 1) a lockfile in the buildchroot or
2) having build.sh wait on a lock itself, if possible.
--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 2434 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dpkg.bbclass: add lockfile for do_build
2018-01-11 15:20 ` Christopher Larson
@ 2018-01-11 17:20 ` Henning Schild
0 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2018-01-11 17:20 UTC (permalink / raw)
To: Christopher Larson; +Cc: Alexander Smirnov, isar-users
Am Thu, 11 Jan 2018 08:20:54 -0700
schrieb Christopher Larson <kergoth@gmail.com>:
> On Thu, Jan 11, 2018 at 5:14 AM, Henning Schild
> <henning.schild@siemens.com> wrote:
>
> > Am Thu, 11 Jan 2018 13:31:45 +0300
> > schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> >
> > > Hello Christopher,
> > >
> > > thank you for this catch!
> > >
> > > On 01/10/2018 07:04 PM, Christopher Larson wrote:
> > > > All recipes using this class will run build.sh in the same
> > > > chroot, and build.sh runs apt-get to install deps, so the build
> > > > can fail due to dpkg being unable to acquire its lock. Add a
> > > > bitbake lockfile to ensure that only one do_build task for
> > > > recipes inheriting this class runs at a time.
> > >
> > > Serialization of do_build tasks leads to whole Isar serialization,
> > > what is significant issue if you have lots of packages to build.
> > > So I think the "build" and "deps installation" should be split in
> > > separate tasks and only the second one should be protected by
> > > locks.
> >
> > The fact that Isar uses multiconfig to build many targets from the
> > same tree is not intuitive, we discussed this before. So i am not
> > surprised new contributors get that "wrong". Alex i suggest you
> > split the task and adopt Christophers changes.
> >
> > Christopher, have a look at scripts/ci_build.sh and you will see
> > that Isar is capable of building multiple images at once in the
> > same tree. If you are building 10 images you will have 10
> > buildchroots that have to be serialized seperately. A feature that
> > probably nobody but the CI-bot will ever use ;).
>
>
> Fair enough, thanks, I’ll re-test with 1) a lockfile in the
> buildchroot or 2) having build.sh wait on a lock itself, if possible.
I just read your signature, and now i guess you can handle the
complexity of multiconf without Alex helping you out. Watch out for
changes to that code in current next.
Henning
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-11 17:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 16:04 [PATCH] dpkg.bbclass: add lockfile for do_build Christopher Larson
2018-01-11 10:31 ` Alexander Smirnov
2018-01-11 12:14 ` Henning Schild
2018-01-11 15:20 ` Christopher Larson
2018-01-11 17:20 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox