summaryrefslogtreecommitdiffstats
path: root/meta/classes
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 17:26:04 +0100
commita67ad9544af1c0d561ae1d5c95abe5147ac7bc17 (patch)
treec65a33f43e960821ffbcbc4e09531a0d0bd359d2 /meta/classes
parent9da1b6e59a4d4234a276bb2ffd37fdb7d9b3183c (diff)
downloadpoky-a67ad9544af1c0d561ae1d5c95abe5147ac7bc17.tar.gz
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. (From OE-Core rev: d46cadbbb42aa71f9436d640891d6ccc8f8e3618) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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() {
1615 shlibswork_dir = d.getVar('SHLIBSWORKDIR') 1615 shlibswork_dir = d.getVar('SHLIBSWORKDIR')
1616 1616
1617 # Take shared lock since we're only reading, not writing 1617 # Take shared lock since we're only reading, not writing
1618 lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}")) 1618 lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
1619 1619
1620 def linux_so(file, needed, sonames, renames, pkgver): 1620 def linux_so(file, needed, sonames, renames, pkgver):
1621 needs_ldconfig = False 1621 needs_ldconfig = False
@@ -1900,7 +1900,7 @@ python package_do_pkgconfig () {
1900 pkgconfig_needed[pkg] += exp.replace(',', ' ').split() 1900 pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
1901 1901
1902 # Take shared lock since we're only reading, not writing 1902 # Take shared lock since we're only reading, not writing
1903 lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}")) 1903 lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
1904 1904
1905 for pkg in packages.split(): 1905 for pkg in packages.split():
1906 pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist") 1906 pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist")
@@ -2233,11 +2233,9 @@ do_package[dirs] = "${SHLIBSWORKDIR} ${PKGDESTWORK} ${D}"
2233do_package[vardeps] += "${PACKAGEBUILDPKGD} ${PACKAGESPLITFUNCS} ${PACKAGEFUNCS} ${@gen_packagevar(d)}" 2233do_package[vardeps] += "${PACKAGEBUILDPKGD} ${PACKAGESPLITFUNCS} ${PACKAGEFUNCS} ${@gen_packagevar(d)}"
2234addtask package after do_install 2234addtask package after do_install
2235 2235
2236PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
2237SSTATETASKS += "do_package" 2236SSTATETASKS += "do_package"
2238do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}" 2237do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}"
2239do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}" 2238do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}"
2240do_package[sstate-lockfile-shared] = "${PACKAGELOCK}"
2241do_package_setscene[dirs] = "${STAGING_DIR}" 2239do_package_setscene[dirs] = "${STAGING_DIR}"
2242 2240
2243python do_package_setscene () { 2241python do_package_setscene () {
@@ -2252,9 +2250,12 @@ do_packagedata () {
2252addtask packagedata before do_build after do_package 2250addtask packagedata before do_build after do_package
2253 2251
2254SSTATETASKS += "do_packagedata" 2252SSTATETASKS += "do_packagedata"
2253# PACKAGELOCK protects readers of PKGDATA_DIR against writes
2254# whilst code is reading in do_package
2255PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
2255do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}" 2256do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
2256do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}" 2257do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
2257do_packagedata[sstate-lockfile-shared] = "${PACKAGELOCK}" 2258do_packagedata[sstate-lockfile] = "${PACKAGELOCK}"
2258do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}" 2259do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}"
2259 2260
2260python do_packagedata_setscene () { 2261python do_packagedata_setscene () {