summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-26 14:24:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-02 14:15:33 +0000
commit2f6d6b9eca05b426dfab50a91cc37b8102c63a26 (patch)
treed81b16e0239487f09309085e8b4bd7477899a3b1
parented7151f9856791fc4a24b1a0a88f87c442b29f38 (diff)
downloadpoky-2f6d6b9eca05b426dfab50a91cc37b8102c63a26.tar.gz
selftest/reproducible: Add ability to pull some objects from sstate
When debugging why a single recipe doesn't reproduce, its a pain to wait for the world to rebuild from scratch. Update the selftest to allow this to be configured, for example you could set targets as ['perf'] and sstate_targets as ['virtual/kernel'] and then it should only be rebuilding perf in the test rather than things like the toolchain (parts of the kernel may be unavoiable as they're not in sstate). Can be run as: OEQA_DEBUGGING_SAVED_OUTPUT=/tmp/perf-diffoscope oe-selftest -r reproducible.ReproducibleTests.test_reproducible_builds to save diffoscope output. (From OE-Core rev: 132a17d02f29711572e14a2f38a841323fbb6df6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/reproducible.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index f2d9f95292..bbc5c0d8a4 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -150,8 +150,14 @@ class DiffoscopeTests(OESelftestTestCase):
150 self.assertTrue(os.path.exists(os.path.join(tmpdir, 'index.html')), "HTML index not found!") 150 self.assertTrue(os.path.exists(os.path.join(tmpdir, 'index.html')), "HTML index not found!")
151 151
152class ReproducibleTests(OESelftestTestCase): 152class ReproducibleTests(OESelftestTestCase):
153 # Test the reproducibility of whatever is built between sstate_targets and targets
154
153 package_classes = ['deb', 'ipk', 'rpm'] 155 package_classes = ['deb', 'ipk', 'rpm']
154 images = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline', 'world'] 156
157 # targets are the things we want to test the reproducibility of
158 targets = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline', 'world']
159 # sstate targets are things to pull from sstate to potentially cut build/debugging time
160 sstate_targets = []
155 save_results = False 161 save_results = False
156 if 'OEQA_DEBUGGING_SAVED_OUTPUT' in os.environ: 162 if 'OEQA_DEBUGGING_SAVED_OUTPUT' in os.environ:
157 save_results = os.environ['OEQA_DEBUGGING_SAVED_OUTPUT'] 163 save_results = os.environ['OEQA_DEBUGGING_SAVED_OUTPUT']
@@ -232,6 +238,11 @@ class ReproducibleTests(OESelftestTestCase):
232 tmpdir=tmpdir) 238 tmpdir=tmpdir)
233 239
234 if not use_sstate: 240 if not use_sstate:
241 if self.sstate_targets:
242 self.logger.info("Building prebuild for %s (sstate allowed)..." % (name))
243 self.write_config(config)
244 bitbake(' '.join(self.sstate_targets))
245
235 # This config fragment will disable using shared and the sstate 246 # This config fragment will disable using shared and the sstate
236 # mirror, forcing a complete build from scratch 247 # mirror, forcing a complete build from scratch
237 config += textwrap.dedent('''\ 248 config += textwrap.dedent('''\
@@ -242,7 +253,8 @@ class ReproducibleTests(OESelftestTestCase):
242 self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT')) 253 self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))
243 self.write_config(config) 254 self.write_config(config)
244 d = get_bb_vars(capture_vars) 255 d = get_bb_vars(capture_vars)
245 bitbake(' '.join(self.images)) 256 # targets used to be called images
257 bitbake(' '.join(getattr(self, 'images', self.targets)))
246 return d 258 return d
247 259
248 def test_reproducible_builds(self): 260 def test_reproducible_builds(self):