summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-09 12:53:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-21 16:51:06 +0100
commit200362645b46541b561627154e8b40680058cffc (patch)
treee4be60c0cc33754c3122d622a55eace8a34bad85 /bitbake/lib
parent072430b9b3a78b318b66371c36e2986d2ed5cba4 (diff)
downloadpoky-200362645b46541b561627154e8b40680058cffc.tar.gz
bitbake: cooker: Track directories searched for bbappend/bb files
Some of the directories searched by BBFILES are not currently being added to the inotify watch list. This can mean that added append files are not noticed leading to misleading metadata results when using BB_SERVER_TIMEOUT != 0. We use glob to expand the BBFILES references and without writing our own implentation, figuring out the directories it searches is hard. We use some horrible hacks here to intecept the listdir calls, I'm open to better ways to handle this but this does ensure we have the right watches set. (Bitbake rev: a161ea021a1e309c25d1adc09e6e3fc58442c893) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/cooker.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index bc8574aa1e..38c22f50ed 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1321,7 +1321,7 @@ class BBCooker:
1321 bf = os.path.abspath(bf) 1321 bf = os.path.abspath(bf)
1322 1322
1323 self.collection = CookerCollectFiles(self.bbfile_config_priorities) 1323 self.collection = CookerCollectFiles(self.bbfile_config_priorities)
1324 filelist, masked = self.collection.collect_bbfiles(self.data, self.data) 1324 filelist, masked, searchdirs = self.collection.collect_bbfiles(self.data, self.data)
1325 try: 1325 try:
1326 os.stat(bf) 1326 os.stat(bf)
1327 bf = os.path.abspath(bf) 1327 bf = os.path.abspath(bf)
@@ -1641,7 +1641,11 @@ class BBCooker:
1641 self.recipecaches[mc].ignored_dependencies.add(dep) 1641 self.recipecaches[mc].ignored_dependencies.add(dep)
1642 1642
1643 self.collection = CookerCollectFiles(self.bbfile_config_priorities) 1643 self.collection = CookerCollectFiles(self.bbfile_config_priorities)
1644 (filelist, masked) = self.collection.collect_bbfiles(self.data, self.data) 1644 (filelist, masked, searchdirs) = self.collection.collect_bbfiles(self.data, self.data)
1645
1646 # Add inotify watches for directories searched for bb/bbappend files
1647 for dirent in searchdirs:
1648 self.add_filewatch([[dirent]])
1645 1649
1646 self.parser = CookerParser(self, filelist, masked) 1650 self.parser = CookerParser(self, filelist, masked)
1647 self.parsecache_valid = True 1651 self.parsecache_valid = True
@@ -1876,6 +1880,18 @@ class CookerCollectFiles(object):
1876 collectlog.error("no recipe files to build, check your BBPATH and BBFILES?") 1880 collectlog.error("no recipe files to build, check your BBPATH and BBFILES?")
1877 bb.event.fire(CookerExit(), eventdata) 1881 bb.event.fire(CookerExit(), eventdata)
1878 1882
1883 # We need to track where we look so that we can add inotify watches. There
1884 # is no nice way to do this, this is horrid. We intercept the os.listdir()
1885 # calls while we run glob().
1886 origlistdir = os.listdir
1887 searchdirs = []
1888
1889 def ourlistdir(d):
1890 searchdirs.append(d)
1891 return origlistdir(d)
1892
1893 os.listdir = ourlistdir
1894
1879 # Can't use set here as order is important 1895 # Can't use set here as order is important
1880 newfiles = [] 1896 newfiles = []
1881 for f in files: 1897 for f in files:
@@ -1893,6 +1909,8 @@ class CookerCollectFiles(object):
1893 if g not in newfiles: 1909 if g not in newfiles:
1894 newfiles.append(g) 1910 newfiles.append(g)
1895 1911
1912 os.listdir = origlistdir
1913
1896 bbmask = config.getVar('BBMASK') 1914 bbmask = config.getVar('BBMASK')
1897 1915
1898 if bbmask: 1916 if bbmask:
@@ -1951,7 +1969,7 @@ class CookerCollectFiles(object):
1951 topfile = bbfile_seen[base] 1969 topfile = bbfile_seen[base]
1952 self.overlayed[topfile].append(f) 1970 self.overlayed[topfile].append(f)
1953 1971
1954 return (bbfiles, masked) 1972 return (bbfiles, masked, searchdirs)
1955 1973
1956 def get_file_appends(self, fn): 1974 def get_file_appends(self, fn):
1957 """ 1975 """