From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6665957031077216256 Date: Fri, 8 Mar 2019 05:33:48 -0800 (PST) From: cedric_hombourger@mentor.com To: isar-users Message-Id: <35924a2e-5207-453e-afa3-609478c5b4e1@googlegroups.com> In-Reply-To: <473ab398-0c28-00d9-5dd2-8caafb7dbf5f@siemens.com> References: <1552039053-1152-1-git-send-email-Cedric_Hombourger@mentor.com> <473ab398-0c28-00d9-5dd2-8caafb7dbf5f@siemens.com> Subject: Re: [PATCH] dpkg: acquire a read (shared) locks while building packages MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1144_1797250126.1552052029056" X-Google-Token: ELzeieQFkrSEygCttjw0 X-Google-IP: 95.176.90.117 X-TUID: H7o8jZfrfTLq ------=_Part_1144_1797250126.1552052029056 Content-Type: multipart/alternative; boundary="----=_Part_1145_1123069327.1552052029056" ------=_Part_1145_1123069327.1552052029056 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Friday, March 8, 2019 at 11:04:12 AM UTC+1, Jan Kiszka wrote: > > > 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} > > } > > > > Couldn't we have the same issue with dpkg-base derived classes? The > kernel? Or > downstream classes? IOW, shouldn't this go to the caller of dpkg_runbuild? I do understand the intent but I don't think we can do something like: flock -s dpkg_runbuild is there another flock construct we could use to get around this? I can update the patch to correct the typo in the commit log ------=_Part_1145_1123069327.1552052029056 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Friday, March 8, 2019 at 11:04:12 AM UTC+1, Jan= Kiszka wrote:
> 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] =3D = "${DISTRO}-${DISTRO_ARCH}"
> =C2=A0 # Build package from sources using build script
> =C2=A0 dpkg_runbuild() {
> =C2=A0 =C2=A0 =C2=A0 E=3D"${@ bb.utils.export_proxies(d)}&quo= t;
> + =C2=A0 =C2=A0flock -s "${REPO_ISAR_DIR}/isar.lock" \
> =C2=A0 =C2=A0 =C2=A0 sudo -E chroot --userspec=3D$( id -u ):$( id = -g ) ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} ${DISTRO_ARCH}
> =C2=A0 }
>=20

Couldn't we have the same issue with dpkg-base derived classes? The= kernel? Or=20
downstream classes? IOW, shouldn't this go to the caller of dpkg_ru= nbuild?

I do understand the intent but I do= n't think we can do something like:
flock -s <lock-file>= ; dpkg_runbuild

is there another flock construct w= e could use to get around this?

I can update the p= atch to correct the typo in the commit log
=C2=A0
------=_Part_1145_1123069327.1552052029056-- ------=_Part_1144_1797250126.1552052029056--