]> code.ossystems Code Review - openembedded-core.git/commitdiff
autotools/siteinfo: Avoid races over siteinfo files
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Feb 2015 14:50:11 +0000 (14:50 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Feb 2015 14:49:31 +0000 (14:49 +0000)
If a siteinfo enabled tasks re-executes at the wrong moment whilst something else is
in do_configure, the _config files can be removed which upsets autoconf and
causes build failures.

Use the same approach as we do for dealing with the aclocal files. We already
parse the manifests so look out any *_config files and if so, copy them, then
reference the copy from siteinfo instead. This has the advantage of also being
more deterministic.

[YOCTO #7101]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/autotools.bbclass
meta/classes/siteinfo.bbclass

index 402ee1bf016076098b6975a547b791e8e774df87..046e83dc9b20d169c72d9c3a962a2037e9b75532 100644 (file)
@@ -27,7 +27,7 @@ inherit siteinfo
 
 # Space separated list of shell scripts with variables defined to supply test
 # results for autoconf tests we cannot run at build time.
-export CONFIG_SITE = "${@siteinfo_get_files(d)}"
+export CONFIG_SITE = "${@siteinfo_get_files(d, False)}"
 
 acpaths = "default"
 EXTRA_AUTORECONF = "--exclude=autopoint"
@@ -187,6 +187,7 @@ python autotools_copy_aclocals () {
     #bb.warn(str(configuredeps2))
 
     cp = []
+    siteconf = []    
     for c in configuredeps:
         if c.endswith("-native"):
             manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
@@ -201,6 +202,8 @@ python autotools_copy_aclocals () {
             for l in f:
                 if "/aclocal/" in l and l.strip().endswith(".m4"):
                     cp.append(l.strip())
+                elif "config_site.d/" in l:
+                    cp.append(l.strip())
         except:
             bb.warn("%s not found" % manifest)
 
@@ -208,6 +211,8 @@ python autotools_copy_aclocals () {
         t = os.path.join(aclocaldir, os.path.basename(c))
         if not os.path.exists(t):
             os.symlink(c, t)
+            
+    d.setVar("CONFIG_SITE", siteinfo_get_files(d, False))
 }
 autotools_copy_aclocals[vardepsexclude] += "MACHINE SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
 
index b41db46bc0561662d4415d6c7540c7592221a598..2c1f9d07fcac868f1b5b4f4784b3b70f9c6bbb27 100644 (file)
@@ -150,9 +150,13 @@ def siteinfo_get_files(d, no_cache = False):
     if no_cache: return sitefiles
 
     # Now check for siteconfig cache files
-    path_siteconfig = d.getVar('SITECONFIG_SYSROOTCACHE', True)
-    if os.path.isdir(path_siteconfig):
+    # Use the files copied to the aclocal cache generated by autotools.bbclass
+    # to avoid races
+    path_siteconfig = d.getVar('ACLOCALDIR', True)
+    if path_siteconfig and os.path.isdir(path_siteconfig):
         for i in os.listdir(path_siteconfig):
+            if not i.endswith("_config"):
+                continue
             filename = os.path.join(path_siteconfig, i)
             sitefiles += filename + " "