summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-20 08:25:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-23 11:12:03 +0100
commitd46cadbbb42aa71f9436d640891d6ccc8f8e3618 (patch)
tree571fbb731c1b5095c24b3bc25ca519462e1416b6
parent593ffffc3baf064b982891d61dacebd08aed3e96 (diff)
downloadopenembedded-core-d46cadbbb42aa71f9436d640891d6ccc8f8e3618.tar.gz
openembedded-core-d46cadbbb42aa71f9436d640891d6ccc8f8e3618.tar.bz2
openembedded-core-d46cadbbb42aa71f9436d640891d6ccc8f8e3618.zip
package: Fix PACKAGELOCK handling
PACKAGELOCK is there to protect readers of PKGDATA_DIR from writes and files changing whilst they're being read. With various changes to the codebase, the lock code has become confused as the files are now written by the sstate code in do_packagedata, not in do_package directly any longer. This change cleans up the code so read sites take the shared lock (anything in do_package), write sites take the full lock (do_packagedata sstate). The lock from do_package sstate is no longer needed since it doesn't write outside WORKDIR. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/package.bbclass11
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 0436d919e7..e03d4502c4 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1615,7 +1615,7 @@ python package_do_shlibs() {
shlibswork_dir = d.getVar('SHLIBSWORKDIR')
# Take shared lock since we're only reading, not writing
- lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
+ lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
def linux_so(file, needed, sonames, renames, pkgver):
needs_ldconfig = False
@@ -1900,7 +1900,7 @@ python package_do_pkgconfig () {
pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
# Take shared lock since we're only reading, not writing
- lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
+ lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
for pkg in packages.split():
pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist")
@@ -2233,11 +2233,9 @@ do_package[dirs] = "${SHLIBSWORKDIR} ${PKGDESTWORK} ${D}"
do_package[vardeps] += "${PACKAGEBUILDPKGD} ${PACKAGESPLITFUNCS} ${PACKAGEFUNCS} ${@gen_packagevar(d)}"
addtask package after do_install
-PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
SSTATETASKS += "do_package"
do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}"
do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}"
-do_package[sstate-lockfile-shared] = "${PACKAGELOCK}"
do_package_setscene[dirs] = "${STAGING_DIR}"
python do_package_setscene () {
@@ -2252,9 +2250,12 @@ do_packagedata () {
addtask packagedata before do_build after do_package
SSTATETASKS += "do_packagedata"
+# PACKAGELOCK protects readers of PKGDATA_DIR against writes
+# whilst code is reading in do_package
+PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
-do_packagedata[sstate-lockfile-shared] = "${PACKAGELOCK}"
+do_packagedata[sstate-lockfile] = "${PACKAGELOCK}"
do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}"
python do_packagedata_setscene () {