From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id D23FA7066B for ; Thu, 12 Feb 2015 14:50:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t1CEoPTj029159 for ; Thu, 12 Feb 2015 14:50:25 GMT Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XvJv2EGUS-su for ; Thu, 12 Feb 2015 14:50:25 +0000 (GMT) Received: from [192.168.3.10] ([192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t1CEoBEx029155 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 12 Feb 2015 14:50:23 GMT Message-ID: <1423752611.20217.67.camel@linuxfoundation.org> From: Richard Purdie To: openembedded-core Date: Thu, 12 Feb 2015 14:50:11 +0000 X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Subject: autotools/siteinfo: Avoid races over siteinfo files X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2015 14:50:29 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 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 + " "