aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/siteinfo.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-21 11:53:57 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-22 11:08:23 +0100
commit3207244004c612c1a0e13921251003e5e635d1b1 (patch)
treebf8e99cb9c8c7d467f829f40d6665ee859c663ec /meta/classes/siteinfo.bbclass
parentf60fc2dc231ffc8cbf5939b0dbfa06c5fe805b86 (diff)
downloadopenembedded-core-3207244004c612c1a0e13921251003e5e635d1b1.tar.gz
autotools/siteinfo: Tweak CONFIG_SITE handling for determism/races
As things stand there are multiple races in the CONFIG_SITE handling where checksums can change depending on whether site directories exist or not when parsing happens. This is bad. Secondly, there is a build race that occurs if you build virtuals in parallel with the "main" recipe, since the main recipe is parsed when the virtual is (since it sets variables like BBCLASSEXTEND) and with the current code, it may look for files and directories which could be created/destroyed which the loop is executing. This is also bad. The aclocal-copy directory should only ever be accessed by the call from autotools.bbclass. This changes the parameter name to make it clear and ensures all callers have the right usage, neatly avoiding all the problems above. Also added better comments. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/siteinfo.bbclass')
-rw-r--r--meta/classes/siteinfo.bbclass17
1 files changed, 11 insertions, 6 deletions
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index 03d4c4fd20..6a2e4bf560 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -153,7 +153,7 @@ python () {
bb.fatal("Please add your architecture to siteinfo.bbclass")
}
-def siteinfo_get_files(d, no_cache = False):
+def siteinfo_get_files(d, aclocalcache = False):
sitedata = siteinfo_data(d)
sitefiles = ""
for path in d.getVar("BBPATH", True).split(":"):
@@ -162,11 +162,17 @@ def siteinfo_get_files(d, no_cache = False):
if os.path.exists(filename):
sitefiles += filename + " "
- if no_cache: return sitefiles
+ if not aclocalcache:
+ return sitefiles
- # Now check for siteconfig cache files
- # Use the files copied to the aclocal cache generated by autotools.bbclass
- # to avoid races
+ # Now check for siteconfig cache files in the directory setup by autotools.bbclass to
+ # avoid races.
+ #
+ # ACLOCALDIR may or may not exist so cache should only be set to True from autotools.bbclass
+ # after files have been copied into this location. To do otherwise risks parsing/signature
+ # issues and the directory being created/removed whilst this code executes. This can happen
+ # when a multilib recipe is parsed along with its base variant which may be running at the time
+ # causing rare but nasty failures
path_siteconfig = d.getVar('ACLOCALDIR', True)
if path_siteconfig and os.path.isdir(path_siteconfig):
for i in os.listdir(path_siteconfig):
@@ -174,7 +180,6 @@ def siteinfo_get_files(d, no_cache = False):
continue
filename = os.path.join(path_siteconfig, i)
sitefiles += filename + " "
-
return sitefiles
#