summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/reproducible.py
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-18 21:20:24 +0000
commit97b0e371fa6cec899253e5d60b07478765e133fa (patch)
tree14acb9225d7138c78f3d07215de1e3270dee06ac /meta/lib/oeqa/selftest/cases/reproducible.py
parentd391393dad3abe449332afc436715c1bc5b698d9 (diff)
downloadpoky-97b0e371fa6cec899253e5d60b07478765e133fa.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: 8b38cd1b36f3e227a63c0aa3955f3f5ab172c509) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 132a17d02f29711572e14a2f38a841323fbb6df6) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/reproducible.py')
-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 7f74cec28f..f570958f80 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -78,8 +78,14 @@ def compare_file(reference, test, diffutils_sysroot):
78 return result 78 return result
79 79
80class ReproducibleTests(OESelftestTestCase): 80class ReproducibleTests(OESelftestTestCase):
81 # Test the reproducibility of whatever is built between sstate_targets and targets
82
81 package_classes = ['deb', 'ipk'] 83 package_classes = ['deb', 'ipk']
82 images = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline'] 84
85 # targets are the things we want to test the reproducibility of
86 targets = ['core-image-minimal', 'core-image-sato', 'core-image-full-cmdline']
87 # sstate targets are things to pull from sstate to potentially cut build/debugging time
88 sstate_targets = []
83 save_results = False 89 save_results = False
84 if 'OEQA_DEBUGGING_SAVED_OUTPUT' in os.environ: 90 if 'OEQA_DEBUGGING_SAVED_OUTPUT' in os.environ:
85 save_results = os.environ['OEQA_DEBUGGING_SAVED_OUTPUT'] 91 save_results = os.environ['OEQA_DEBUGGING_SAVED_OUTPUT']
@@ -154,6 +160,11 @@ class ReproducibleTests(OESelftestTestCase):
154 tmpdir=tmpdir) 160 tmpdir=tmpdir)
155 161
156 if not use_sstate: 162 if not use_sstate:
163 if self.sstate_targets:
164 self.logger.info("Building prebuild for %s (sstate allowed)..." % (name))
165 self.write_config(config)
166 bitbake(' '.join(self.sstate_targets))
167
157 # This config fragment will disable using shared and the sstate 168 # This config fragment will disable using shared and the sstate
158 # mirror, forcing a complete build from scratch 169 # mirror, forcing a complete build from scratch
159 config += textwrap.dedent('''\ 170 config += textwrap.dedent('''\
@@ -164,7 +175,8 @@ class ReproducibleTests(OESelftestTestCase):
164 self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT')) 175 self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))
165 self.write_config(config) 176 self.write_config(config)
166 d = get_bb_vars(capture_vars) 177 d = get_bb_vars(capture_vars)
167 bitbake(' '.join(self.images)) 178 # targets used to be called images
179 bitbake(' '.join(getattr(self, 'images', self.targets)))
168 return d 180 return d
169 181
170 def test_reproducible_builds(self): 182 def test_reproducible_builds(self):