summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2019-11-15 08:47:23 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-11 11:06:22 +0000
commitf619b134039765e86bc0dec86485953b623ee89f (patch)
tree42ea7f779d84f6a761a2e4358ed4f8c3bd643cdb /bitbake
parentb51364db489f9749c10a85c0a487d7ecb21d2e93 (diff)
downloadpoky-f619b134039765e86bc0dec86485953b623ee89f.tar.gz
bitbake: lib/bb: Add BB_SIGNATURE_LOCAL_DIRS_EXCLUDE to speed-up taskhash on directories
The new BB_SIGNATURE_LOCAL_DIRS_EXCLUDE allows you to specify a list of directories to exclude when making taskhash, our specific case is using SRC_URI that points local VCS directory. Use bb.fetch.module to set default to: "CVS .bzr .git .hg .osc .p4 .repo .svn" (Bitbake rev: 4c7d689341f471efdf8ab7c2a7c6a19d2d370f5c) Signed-off-by: Aníbal Limón <anibal.limon@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 923aff060d8aba8456979c35b16d300ba7c13ff9) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/checksum.py5
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py4
-rw-r--r--bitbake/lib/bb/siggen.py5
3 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/checksum.py b/bitbake/lib/bb/checksum.py
index 5bc8a8fcb6..677020f497 100644
--- a/bitbake/lib/bb/checksum.py
+++ b/bitbake/lib/bb/checksum.py
@@ -74,7 +74,7 @@ class FileChecksumCache(MultiProcessCache):
74 else: 74 else:
75 dest[0][h] = source[0][h] 75 dest[0][h] = source[0][h]
76 76
77 def get_checksums(self, filelist, pn): 77 def get_checksums(self, filelist, pn, localdirsexclude):
78 """Get checksums for a list of files""" 78 """Get checksums for a list of files"""
79 79
80 def checksum_file(f): 80 def checksum_file(f):
@@ -90,7 +90,8 @@ class FileChecksumCache(MultiProcessCache):
90 if pth == "/": 90 if pth == "/":
91 bb.fatal("Refusing to checksum /") 91 bb.fatal("Refusing to checksum /")
92 dirchecksums = [] 92 dirchecksums = []
93 for root, dirs, files in os.walk(pth): 93 for root, dirs, files in os.walk(pth, topdown=True):
94 [dirs.remove(d) for d in list(dirs) if d in localdirsexclude]
94 for name in files: 95 for name in files:
95 fullpth = os.path.join(root, name) 96 fullpth = os.path.join(root, name)
96 checksum = checksum_file(fullpth) 97 checksum = checksum_file(fullpth)
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 07de6c2693..731c160892 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1197,14 +1197,14 @@ def get_checksum_file_list(d):
1197 1197
1198 return " ".join(filelist) 1198 return " ".join(filelist)
1199 1199
1200def get_file_checksums(filelist, pn): 1200def get_file_checksums(filelist, pn, localdirsexclude):
1201 """Get a list of the checksums for a list of local files 1201 """Get a list of the checksums for a list of local files
1202 1202
1203 Returns the checksums for a list of local files, caching the results as 1203 Returns the checksums for a list of local files, caching the results as
1204 it proceeds 1204 it proceeds
1205 1205
1206 """ 1206 """
1207 return _checksum_cache.get_checksums(filelist, pn) 1207 return _checksum_cache.get_checksums(filelist, pn, localdirsexclude)
1208 1208
1209 1209
1210class FetchData(object): 1210class FetchData(object):
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index e484e5e37d..f982bf22bc 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -126,6 +126,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
126 126
127 self.unihash_cache = bb.cache.SimpleCache("1") 127 self.unihash_cache = bb.cache.SimpleCache("1")
128 self.unitaskhashes = self.unihash_cache.init_cache(data, "bb_unihashes.dat", {}) 128 self.unitaskhashes = self.unihash_cache.init_cache(data, "bb_unihashes.dat", {})
129 self.localdirsexclude = (data.getVar("BB_SIGNATURE_LOCAL_DIRS_EXCLUDE") or "CVS .bzr .git .hg .osc .p4 .repo .svn").split()
129 130
130 def init_rundepcheck(self, data): 131 def init_rundepcheck(self, data):
131 self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None 132 self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None
@@ -222,9 +223,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
222 223
223 if task in dataCache.file_checksums[fn]: 224 if task in dataCache.file_checksums[fn]:
224 if self.checksum_cache: 225 if self.checksum_cache:
225 checksums = self.checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename) 226 checksums = self.checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename, self.localdirsexclude)
226 else: 227 else:
227 checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename) 228 checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename, self.localdirsexclude)
228 for (f,cs) in checksums: 229 for (f,cs) in checksums:
229 self.file_checksum_values[tid].append((f,cs)) 230 self.file_checksum_values[tid].append((f,cs))
230 231