summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-04-11 20:38:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-12 15:09:58 +0100
commite93a2ab3e300bb861cf6cc83716f93d671ff80f4 (patch)
treefa8e90db9ab55b4c7e6ece7a84bc5c0c83c22598 /scripts
parent937c1ea9746d597d30de1e1953757b9ca1b2c8ad (diff)
downloadpoky-e93a2ab3e300bb861cf6cc83716f93d671ff80f4.tar.gz
yocto-compat-layer: also determine tune flags for each task
locked-sigs.inc groups tasks according to their tune flags (allarch, i586, etc.). Also retrieve that information while getting signatures, it will be needed to determine when setting a machine changes tasks that aren't machine-specific. (From OE-Core rev: 67f9a8759f47680dbf349797801b2a1e8d149377) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/compatlayer/__init__.py9
-rw-r--r--scripts/lib/compatlayer/cases/common.py2
-rwxr-xr-xscripts/yocto-compat-layer.py2
3 files changed, 10 insertions, 3 deletions
diff --git a/scripts/lib/compatlayer/__init__.py b/scripts/lib/compatlayer/__init__.py
index b46527a185..6130b8548c 100644
--- a/scripts/lib/compatlayer/__init__.py
+++ b/scripts/lib/compatlayer/__init__.py
@@ -224,6 +224,7 @@ def get_signatures(builddir, failsafe=False):
224 exclude_recipes = ('meta-world-pkgdata',) 224 exclude_recipes = ('meta-world-pkgdata',)
225 225
226 sigs = {} 226 sigs = {}
227 tune2tasks = {}
227 228
228 cmd = 'bitbake ' 229 cmd = 'bitbake '
229 if failsafe: 230 if failsafe:
@@ -234,9 +235,14 @@ def get_signatures(builddir, failsafe=False):
234 sigs_file = os.path.join(builddir, 'locked-sigs.inc') 235 sigs_file = os.path.join(builddir, 'locked-sigs.inc')
235 236
236 sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$") 237 sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$")
238 tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*")
239 current_tune = None
237 with open(sigs_file, 'r') as f: 240 with open(sigs_file, 'r') as f:
238 for line in f.readlines(): 241 for line in f.readlines():
239 line = line.strip() 242 line = line.strip()
243 t = tune_regex.search(line)
244 if t:
245 current_tune = t.group('tune')
240 s = sig_regex.match(line) 246 s = sig_regex.match(line)
241 if s: 247 if s:
242 exclude = False 248 exclude = False
@@ -249,11 +255,12 @@ def get_signatures(builddir, failsafe=False):
249 continue 255 continue
250 256
251 sigs[s.group('task')] = s.group('hash') 257 sigs[s.group('task')] = s.group('hash')
258 tune2tasks.setdefault(current_tune, []).append(s.group('task'))
252 259
253 if not sigs: 260 if not sigs:
254 raise RuntimeError('Can\'t load signatures from %s' % sigs_file) 261 raise RuntimeError('Can\'t load signatures from %s' % sigs_file)
255 262
256 return sigs 263 return (sigs, tune2tasks)
257 264
258def get_depgraph(targets=['world']): 265def get_depgraph(targets=['world']):
259 ''' 266 '''
diff --git a/scripts/lib/compatlayer/cases/common.py b/scripts/lib/compatlayer/cases/common.py
index a4c2a51aba..8eeada9b1e 100644
--- a/scripts/lib/compatlayer/cases/common.py
+++ b/scripts/lib/compatlayer/cases/common.py
@@ -33,7 +33,7 @@ class CommonCompatLayer(OECompatLayerTestCase):
33 33
34 # task -> (old signature, new signature) 34 # task -> (old signature, new signature)
35 sig_diff = {} 35 sig_diff = {}
36 curr_sigs = get_signatures(self.td['builddir'], failsafe=True) 36 curr_sigs, _ = get_signatures(self.td['builddir'], failsafe=True)
37 for task in self.td['sigs']: 37 for task in self.td['sigs']:
38 if task in curr_sigs and \ 38 if task in curr_sigs and \
39 self.td['sigs'][task] != curr_sigs[task]: 39 self.td['sigs'][task] != curr_sigs[task]:
diff --git a/scripts/yocto-compat-layer.py b/scripts/yocto-compat-layer.py
index 22c0c2ddea..2ebddb66d0 100755
--- a/scripts/yocto-compat-layer.py
+++ b/scripts/yocto-compat-layer.py
@@ -139,7 +139,7 @@ def main():
139 td['bbvars'] = get_bb_vars() 139 td['bbvars'] = get_bb_vars()
140 logger.info('Getting initial signatures ...') 140 logger.info('Getting initial signatures ...')
141 td['builddir'] = builddir 141 td['builddir'] = builddir
142 td['sigs'] = get_signatures(td['builddir']) 142 td['sigs'], td['tunetasks'] = get_signatures(td['builddir'])
143 143
144 if not add_layer(bblayersconf, layer, dep_layers, logger): 144 if not add_layer(bblayersconf, layer, dep_layers, logger):
145 logger.info('Skipping %s ???.' % layer['name']) 145 logger.info('Skipping %s ???.' % layer['name'])