From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6665957031077216256 X-Received: by 2002:a1c:a741:: with SMTP id q62mr1422398wme.7.1552039066628; Fri, 08 Mar 2019 01:57:46 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:8241:: with SMTP id 59ls1860853wrb.5.gmail; Fri, 08 Mar 2019 01:57:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzz4QM2edy7Z7GzCL2q3ciXMiBaEo6F8go1Cfa8vCnc0T4I57NO3zOFe8+uay3x42xrmDfa X-Received: by 2002:a5d:69c5:: with SMTP id s5mr492032wrw.3.1552039066262; Fri, 08 Mar 2019 01:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552039066; cv=none; d=google.com; s=arc-20160816; b=DyRr7vVvmyBzRxT33Qtzxd0rt9jc01ewrB6yMMp9daoMd4cgwEPpqZYy6BhsB1SXJX 7g2371KJowV0jtlpx3W3W1gJUnSDiIzT/pMxMQjJv0utJWhHSZit/MS2bO3wsKWg6FYl 02PHj44HAe2j+fomdmHg5iSVvAIRiFys3uvwDkF9nht/oFYCBKPqtfYIRlEcL8G+pM+y S8kZBTMEInQ020q/JN8tfz+Ydv6gM09T73n7fXylZcyOLvo9zmxzdcbAX2qChoIwGY59 /kDgO2d++envraThwTEXnsDDNrA8v8AlI/RRQlkJAsAIUUIjgAuDN93zoUV1ehlad8j6 rS8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from; bh=KUHK1sG4m6eX08gbNBZbkiRvfcxhsoBlKjaOeT5Gd1Y=; b=0ZqomDmPK88iclm/d3yiEz2tz0pHldW7XtGqfU4gUjbuDM5bhj/1MQMRAZykvvcL3+ KtfLma/PPidETTHsxFgpykSnpw++KWO4pSaFKVTeUHkgMTfch7pkOADsX69+jRyTpOd1 +NaDhkDcpSoskHstP+qztDN4jtci2B3lBAmdvrV2U+Vlob7EK4rVlzBbJSn04O3SGXkl PNUX6WK6LYe75WFlAzS8Yh3DvkBLCV7XlGuoWeUk62f7m09uLrmPe42aaXw1OQ4Q+jSs Ll4AA0R1kvX6vVOetrinLfX8RQXa+v7RlR3zRJniIeCqa4Kgx0/8nZFGtlGgJycT+woh pmpQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by gmr-mx.google.com with ESMTPS id r15si350591wmc.4.2019.03.08.01.57.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 01:57:46 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) client-ip=192.94.38.131; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-02.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1h2CG8-0001M2-SV from Cedric_Hombourger@mentor.com for isar-users@googlegroups.com; Fri, 08 Mar 2019 01:57:44 -0800 Received: from FRG-W10-HOMBOUR.world.mentorg.com (137.202.0.90) by svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 8 Mar 2019 09:57:41 +0000 From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH] dpkg: acquire a read (shared) locks while building packages Date: Fri, 8 Mar 2019 10:57:33 +0100 Message-ID: <1552039053-1152-1-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: ewxoErVkwXa7 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 --- 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