summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-09-29 13:45:36 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-29 14:42:25 +0100
commitf963541dc040c0c5d7f5378cc0cfda5752208bbd (patch)
tree55c052b99b2cb745d3e9b616e15d29ba83648d82 /meta
parent57eb677f0efe9a4060c764e8e9dfe2440d4e5eb2 (diff)
downloadast2050-yocto-poky-f963541dc040c0c5d7f5378cc0cfda5752208bbd.zip
ast2050-yocto-poky-f963541dc040c0c5d7f5378cc0cfda5752208bbd.tar.gz
sstate: run recipe-provided hooks outside of ${B}
To avoid races between the sstate tasks/hooks using ${B} as the cwd, and other tasks such as cmake_do_configure which deletes and re-creates ${B}, ensure that all sstate hooks are run in the right directory, and run the prefunc/postfunc in WORKDIR. (From OE-Core rev: 07a7e1a0bee5b8757951e67c9353c786a6ac8500) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sstate.bbclass30
1 files changed, 14 insertions, 16 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index a710305..5c81a1c 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -44,16 +44,6 @@ EXTRA_STAGING_FIXMES ?= ""
SIGGEN_LOCKEDSIGS_CHECK_LEVEL ?= 'error'
-# Specify dirs in which the shell function is executed and don't use ${B}
-# as default dirs to avoid possible race about ${B} with other task.
-sstate_create_package[dirs] = "${SSTATE_BUILDDIR}"
-sstate_unpack_package[dirs] = "${SSTATE_INSTDIR}"
-
-# Do not run sstate_hardcode_path() in ${B}:
-# the ${B} maybe removed by cmake_do_configure() while
-# sstate_hardcode_path() running.
-sstate_hardcode_path[dirs] = "${SSTATE_BUILDDIR}"
-
python () {
if bb.data.inherits_class('native', d):
d.setVar('SSTATE_PKGARCH', d.getVar('BUILD_ARCH'))
@@ -146,6 +136,8 @@ def sstate_install(ss, d):
shareddirs = []
bb.utils.mkdirhier(d.expand("${SSTATE_MANIFESTS}"))
+ sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
+
d2 = d.createCopy()
extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
if extrainf:
@@ -239,7 +231,8 @@ def sstate_install(ss, d):
oe.path.copyhardlinktree(state[1], state[2])
for postinst in (d.getVar('SSTATEPOSTINSTFUNCS', True) or '').split():
- bb.build.exec_func(postinst, d)
+ # All hooks should run in the SSTATE_INSTDIR
+ bb.build.exec_func(postinst, d, (sstateinst,))
for lock in locks:
bb.utils.unlockfile(lock)
@@ -275,7 +268,8 @@ def sstate_installpkg(ss, d):
d.setVar('SSTATE_PKG', sstatepkg)
for f in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split() + ['sstate_unpack_package'] + (d.getVar('SSTATEPOSTUNPACKFUNCS', True) or '').split():
- bb.build.exec_func(f, d)
+ # All hooks should run in the SSTATE_INSTDIR
+ bb.build.exec_func(f, d, (sstateinst,))
for state in ss['dirs']:
prepdir(state[1])
@@ -547,8 +541,9 @@ def sstate_package(ss, d):
for f in (d.getVar('SSTATECREATEFUNCS', True) or '').split() + ['sstate_create_package'] + \
(d.getVar('SSTATEPOSTCREATEFUNCS', True) or '').split():
- bb.build.exec_func(f, d)
-
+ # All hooks should run in SSTATE_BUILDDIR.
+ bb.build.exec_func(f, d, (sstatebuild,))
+
bb.siggen.dump_this_task(sstatepkg + ".siginfo", d)
return
@@ -606,19 +601,22 @@ python sstate_task_prefunc () {
shared_state = sstate_state_fromvars(d)
sstate_clean(shared_state, d)
}
+sstate_task_prefunc[dirs] = "${WORKDIR}"
python sstate_task_postfunc () {
shared_state = sstate_state_fromvars(d)
+
sstate_install(shared_state, d)
for intercept in shared_state['interceptfuncs']:
- bb.build.exec_func(intercept, d)
+ bb.build.exec_func(intercept, d, (d.getVar("WORKDIR", True),))
omask = os.umask(002)
if omask != 002:
bb.note("Using umask 002 (not %0o) for sstate packaging" % omask)
sstate_package(shared_state, d)
os.umask(omask)
}
-
+sstate_task_postfunc[dirs] = "${WORKDIR}"
+
#
# Shell function to generate a sstate package from a directory
OpenPOWER on IntegriCloud