summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-08-29 10:31:06 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-30 17:10:28 +0100
commit7e01f2fdad4b3abedcd86e2d106bc362ef23097f (patch)
treecc74e379030d58fe69e137bddffe235055149246 /meta/lib
parentdc04d6cdc22c15f751b67db690d4c6d31890daa3 (diff)
downloadopenembedded-core-contrib-7e01f2fdad4b3abedcd86e2d106bc362ef23097f.tar.gz
oeqa: reproducible: Do two clean builds
Perform two clean builds without sstate instead of one partial rebuild with sstate and one clean build without. There are some classes of reproducibility issues that this solves, and while we would like to resolve them in the long term the direction to do so is not currently clear. (From OE-Core rev: e97c529bfa4e1d0038ea44f15ee3298003daf981) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/reproducible.py48
1 files changed, 28 insertions, 20 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index c6cc0b7d0e..b3bbb70158 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -123,45 +123,53 @@ class ReproducibleTests(OESelftestTestCase):
def test_reproducible_builds(self):
capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes]
+ # Build native utilities
+ self.write_config('')
+ bitbake("diffutils-native -c addto_recipe_sysroot")
+ diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native")
+
+ # Reproducible builds should not pull from sstate or mirrors, but
+ # sharing DL_DIR is fine
common_config = textwrap.dedent('''\
INHERIT += "reproducible_build"
PACKAGE_CLASSES = "%s"
+ SSTATE_DIR = "${TMPDIR}/sstate"
+ SSTATE_MIRROR = ""
''') % (' '.join('package_%s' % c for c in self.package_classes))
- # Do an initial build. It's acceptable for this build to use sstate
- self.write_config(common_config)
- vars_reference = get_bb_vars(capture_vars)
- bitbake(' '.join(self.images))
+ # Perform a build.
+ reproducibleA_tmp = os.path.join(self.topdir, 'reproducibleA', 'tmp')
+ if os.path.exists(reproducibleA_tmp):
+ bb.utils.remove(reproducibleA_tmp, recurse=True)
- # Build native utilities
- bitbake("diffutils-native -c addto_recipe_sysroot")
- diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native")
+ self.write_config((textwrap.dedent('''\
+ TMPDIR = "%s"
+ ''') % reproducibleA_tmp) + common_config)
+ vars_A = get_bb_vars(capture_vars)
+ bitbake(' '.join(self.images))
- reproducible_tmp = os.path.join(self.topdir, 'reproducible', 'tmp')
- if os.path.exists(reproducible_tmp):
- bb.utils.remove(reproducible_tmp, recurse=True)
+ # Perform another build.
+ reproducibleB_tmp = os.path.join(self.topdir, 'reproducibleB', 'tmp')
+ if os.path.exists(reproducibleB_tmp):
+ bb.utils.remove(reproducibleB_tmp, recurse=True)
- # Perform another build. This build should *not* share sstate or pull
- # from any mirrors, but sharing a DL_DIR is fine
self.write_config((textwrap.dedent('''\
TMPDIR = "%s"
- SSTATE_DIR = "${TMPDIR}/sstate"
- SSTATE_MIRROR = ""
- ''') % reproducible_tmp) + common_config)
- vars_test = get_bb_vars(capture_vars)
+ ''') % reproducibleB_tmp) + common_config)
+ vars_B = get_bb_vars(capture_vars)
bitbake(' '.join(self.images))
- # NOTE: The temp directory from the reproducible build is purposely
+ # NOTE: The temp directories from the reproducible build are purposely
# kept after the build so it can be diffed for debugging.
for c in self.package_classes:
with self.subTest(package_class=c):
package_class = 'package_' + c
- deploy_reference = vars_reference['DEPLOY_DIR_' + c.upper()]
- deploy_test = vars_test['DEPLOY_DIR_' + c.upper()]
+ deploy_A = vars_A['DEPLOY_DIR_' + c.upper()]
+ deploy_B = vars_B['DEPLOY_DIR_' + c.upper()]
- result = self.compare_packages(deploy_reference, deploy_test, diffutils_sysroot)
+ result = self.compare_packages(deploy_A, deploy_B, diffutils_sysroot)
self.logger.info('Reproducibility summary for %s: %s' % (c, result))