summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-28 16:45:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-30 22:40:52 +0100
commit99206cb7b41be7a124ea8339bc891077f02128a2 (patch)
treeffbcbd35a6d56ecb5b731cb7438c188a1bb8e919 /meta/classes/package.bbclass
parentb9bf7d26827fc12d94981efc4920ac367c3c9fce (diff)
downloadpoky-99206cb7b41be7a124ea8339bc891077f02128a2.tar.gz
package: Build pkgdata specific to the current recipe
This switches the code to build pkgdata specific to the current recipe which means that its filtered to the recipes dependencies and can perform better as we can drop the lockfile. It uses a similar method to the staging code to do this, using BB_TASKDEPDATA to construct a list of packagedata task output which this recipe should "see". The original pkgdata store is left unaltered so existing code works. The lock file was there to prevent files disappearing as they were read or as directories were listed. Since we have a copy of the data and only access output from completed tasks (as per their manifests), we can remove the lock. The lock was causing starvation issues on systems with parallelism. There was also a potential determinism problem as the current code could "see" data from recipes which it doesn't depend upon. [YOCTO #13412] (From OE-Core rev: 1951132576bfb95675b4879287f8b3b7c47524fa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass16
1 files changed, 3 insertions, 13 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 70babb3812..8adf6e1650 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -40,6 +40,7 @@
40 40
41inherit packagedata 41inherit packagedata
42inherit chrpath 42inherit chrpath
43inherit package_pkgdata
43 44
44# Need the package_qa_handle_error() in insane.bbclass 45# Need the package_qa_handle_error() in insane.bbclass
45inherit insane 46inherit insane
@@ -1571,7 +1572,7 @@ python package_do_filedeps() {
1571 d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg])) 1572 d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg]))
1572} 1573}
1573 1574
1574SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs2" 1575SHLIBSDIRS = "${WORKDIR_PKGDATA}/${MLPREFIX}shlibs2"
1575SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs2" 1576SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs2"
1576 1577
1577python package_do_shlibs() { 1578python package_do_shlibs() {
@@ -1729,10 +1730,7 @@ python package_do_shlibs() {
1729 1730
1730 needed = {} 1731 needed = {}
1731 1732
1732 # Take shared lock since we're only reading, not writing
1733 lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
1734 shlib_provider = oe.package.read_shlib_providers(d) 1733 shlib_provider = oe.package.read_shlib_providers(d)
1735 bb.utils.unlockfile(lf)
1736 1734
1737 for pkg in shlib_pkgs: 1735 for pkg in shlib_pkgs:
1738 private_libs = d.getVar('PRIVATE_LIBS_' + pkg) or d.getVar('PRIVATE_LIBS') or "" 1736 private_libs = d.getVar('PRIVATE_LIBS_' + pkg) or d.getVar('PRIVATE_LIBS') or ""
@@ -1918,9 +1916,6 @@ python package_do_pkgconfig () {
1918 f.write('%s\n' % p) 1916 f.write('%s\n' % p)
1919 f.close() 1917 f.close()
1920 1918
1921 # Take shared lock since we're only reading, not writing
1922 lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
1923
1924 # Go from least to most specific since the last one found wins 1919 # Go from least to most specific since the last one found wins
1925 for dir in reversed(shlibs_dirs): 1920 for dir in reversed(shlibs_dirs):
1926 if not os.path.exists(dir): 1921 if not os.path.exists(dir):
@@ -1936,8 +1931,6 @@ python package_do_pkgconfig () {
1936 for l in lines: 1931 for l in lines:
1937 pkgconfig_provided[pkg].append(l.rstrip()) 1932 pkgconfig_provided[pkg].append(l.rstrip())
1938 1933
1939 bb.utils.unlockfile(lf)
1940
1941 for pkg in packages.split(): 1934 for pkg in packages.split():
1942 deps = [] 1935 deps = []
1943 for n in pkgconfig_needed[pkg]: 1936 for n in pkgconfig_needed[pkg]:
@@ -2134,6 +2127,7 @@ def gen_packagevar(d):
2134PACKAGE_PREPROCESS_FUNCS ?= "" 2127PACKAGE_PREPROCESS_FUNCS ?= ""
2135# Functions for setting up PKGD 2128# Functions for setting up PKGD
2136PACKAGEBUILDPKGD ?= " \ 2129PACKAGEBUILDPKGD ?= " \
2130 package_prepare_pkgdata \
2137 perform_packagecopy \ 2131 perform_packagecopy \
2138 ${PACKAGE_PREPROCESS_FUNCS} \ 2132 ${PACKAGE_PREPROCESS_FUNCS} \
2139 split_and_strip_files \ 2133 split_and_strip_files \
@@ -2261,12 +2255,8 @@ do_packagedata () {
2261addtask packagedata before do_build after do_package 2255addtask packagedata before do_build after do_package
2262 2256
2263SSTATETASKS += "do_packagedata" 2257SSTATETASKS += "do_packagedata"
2264# PACKAGELOCK protects readers of PKGDATA_DIR against writes
2265# whilst code is reading in do_package
2266PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
2267do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}" 2258do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
2268do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}" 2259do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
2269do_packagedata[sstate-lockfile] = "${PACKAGELOCK}"
2270do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}" 2260do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}"
2271 2261
2272python do_packagedata_setscene () { 2262python do_packagedata_setscene () {