[oe-commits] [openembedded-core] 15/17: classes/waf: Set WAFLOCK
git at git.openembedded.org
git at git.openembedded.org
Tue Apr 23 12:05:33 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit e917112362be3969394d4250a2972aef36cf5134
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Tue Apr 16 09:07:02 2019 -0500
classes/waf: Set WAFLOCK
Sets the WAFLOCK environment variable. This controls the name of the
lock file that waf uses to pass the build configuration from 'configure'
to 'build' and 'install'. Using a uniquely generated name based on the
parameters passed to 'configure' ensures that the source directory can
be configured for multiple different builds without conflicting (since
the lock file is stored in ${S})
Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/waf.bbclass | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index 8e6d754..9002440 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -5,6 +5,32 @@ B = "${WORKDIR}/build"
EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
+def waflock_hash(d):
+ # Calculates the hash used for the waf lock file. This should include
+ # all of the user controllable inputs passed to waf configure. Note
+ # that the full paths for ${B} and ${S} are used; this is OK and desired
+ # because a change to either of these should create a unique lock file
+ # to prevent collisions.
+ import hashlib
+ h = hashlib.sha512()
+ def update(name):
+ val = d.getVar(name)
+ if val is not None:
+ h.update(val.encode('utf-8'))
+ update('S')
+ update('B')
+ update('prefix')
+ update('EXTRA_OECONF')
+ return h.hexdigest()
+
+# Use WAFLOCK to specify a separate lock file. The build is already
+# sufficiently isolated by setting the output directory, this ensures that
+# bitbake won't step on toes of any other configured context in the source
+# directory (e.g. if the source is coming from externalsrc and was previously
+# configured elsewhere).
+export WAFLOCK = ".lock-waf_oe_${@waflock_hash(d)}_build"
+BB_HASHBASE_WHITELIST += "WAFLOCK"
+
python waf_preconfigure() {
import subprocess
from distutils.version import StrictVersion
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list