public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] dpkg: acquire a read (shared) locks while building packages
@ 2019-03-08  9:57 Cedric Hombourger
  2019-03-08 10:04 ` Jan Kiszka
  0 siblings, 1 reply; 10+ messages in thread
From: Cedric Hombourger @ 2019-03-08  9:57 UTC (permalink / raw)
  To: isar-users; +Cc: Cedric Hombourger

As debhelper scripts involved during the actual build process
(dpkg-buildpackage) may access the dpkg database, we need to
make sure it does not get modified in the background by other
build tasks for other packages (such as install_build_deps).
An example of a reader is dh_shlibdeps/dpkg-shlibdeps: it
needs to find packages providing the shared libraries the
package depends on to substitue shlibs variables found in its
control file with package dependencies. Acquire the isar-apt
lock as a shared lock to block writers.

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
---
 meta/classes/dpkg.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 24b9fe3..f4e3d7a 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -19,5 +19,6 @@ do_install_builddeps[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
 # Build package from sources using build script
 dpkg_runbuild() {
     E="${@ bb.utils.export_proxies(d)}"
+    flock -s "${REPO_ISAR_DIR}/isar.lock" \
     sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} ${DISTRO_ARCH}
 }
-- 
2.11.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-15  4:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08  9:57 [PATCH] dpkg: acquire a read (shared) locks while building packages Cedric Hombourger
2019-03-08 10:04 ` Jan Kiszka
2019-03-08 13:33   ` cedric_hombourger
2019-03-08 15:13     ` Jan Kiszka
2019-03-08 15:24       ` cedric_hombourger
2019-03-08 15:27         ` Jan Kiszka
2019-03-08 15:49           ` [PATCH v2] " Cedric Hombourger
2019-03-08 16:38             ` Jan Kiszka
2019-03-14  6:21               ` cedric_hombourger
2019-03-15  4:47             ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox