Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: autotools/siteinfo: Avoid races over siteinfo files
Date: Thu, 12 Feb 2015 14:50:11 +0000	[thread overview]
Message-ID: <1423752611.20217.67.camel@linuxfoundation.org> (raw)

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>

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 5681dbe..f44b9eb 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -29,7 +29,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"
@@ -189,6 +189,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)
@@ -203,6 +204,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)
 
@@ -210,6 +213,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"
 
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index b41db46..2c1f9d0 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -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 + " "
 




                 reply	other threads:[~2015-02-12 14:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423752611.20217.67.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox