summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-04-16 09:07:02 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-23 23:30:20 +0100
commitac45fd87935d25391c2d56a66f5ddfef23c00098 (patch)
tree616e586dfe9c11e90e0de4a0e8a1168aaf541f3e
parentb765109769d61704a9e9dafb238e126d6e0a4df8 (diff)
downloadpoky-ac45fd87935d25391c2d56a66f5ddfef23c00098.tar.gz
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}) (From OE-Core rev: 29419141a42e6b6664f72d085288ba03c74f90a6) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/waf.bbclass26
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index 8e6d754c29..900244004e 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -5,6 +5,32 @@ B = "${WORKDIR}/build"
5 5
6EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" 6EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
7 7
8def waflock_hash(d):
9 # Calculates the hash used for the waf lock file. This should include
10 # all of the user controllable inputs passed to waf configure. Note
11 # that the full paths for ${B} and ${S} are used; this is OK and desired
12 # because a change to either of these should create a unique lock file
13 # to prevent collisions.
14 import hashlib
15 h = hashlib.sha512()
16 def update(name):
17 val = d.getVar(name)
18 if val is not None:
19 h.update(val.encode('utf-8'))
20 update('S')
21 update('B')
22 update('prefix')
23 update('EXTRA_OECONF')
24 return h.hexdigest()
25
26# Use WAFLOCK to specify a separate lock file. The build is already
27# sufficiently isolated by setting the output directory, this ensures that
28# bitbake won't step on toes of any other configured context in the source
29# directory (e.g. if the source is coming from externalsrc and was previously
30# configured elsewhere).
31export WAFLOCK = ".lock-waf_oe_${@waflock_hash(d)}_build"
32BB_HASHBASE_WHITELIST += "WAFLOCK"
33
8python waf_preconfigure() { 34python waf_preconfigure() {
9 import subprocess 35 import subprocess
10 from distutils.version import StrictVersion 36 from distutils.version import StrictVersion