From: Joshua Watt <jpewhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 4/4] oeqa: reproducible: Run diffoscope on saved output
Date: Tue, 11 Feb 2020 21:14:35 -0600 [thread overview]
Message-ID: <20200212031435.792802-5-JPEWhacker@gmail.com> (raw)
In-Reply-To: <20200212031435.792802-1-JPEWhacker@gmail.com>
If there are differing packages and they are being saved for review,
automatically run diffoscope on them and include the output in the saved
output. The output is currently done in HTML format since these are
typically published on a webpage by the autobuilder.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/lib/oeqa/selftest/cases/reproducible.py | 24 ++++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index f6433c9a02b..d3fd8c392b8 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: MIT
#
-# Copyright 2019 by Garmin Ltd. or its subsidiaries
+# Copyright 2019-2020 by Garmin Ltd. or its subsidiaries
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
@@ -167,10 +167,16 @@ class ReproducibleTests(OESelftestTestCase):
return d
def test_reproducible_builds(self):
+ def strip_topdir(s):
+ if s.startswith(self.topdir):
+ return s[len(self.topdir):]
+ return s
+
# Build native utilities
self.write_config('')
- bitbake("diffutils-native -c addto_recipe_sysroot")
+ bitbake("diffoscope-native diffutils-native -c addto_recipe_sysroot")
diffutils_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffutils-native")
+ diffoscope_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "diffoscope-native")
if self.save_results:
os.makedirs(self.save_results, exist_ok=True)
@@ -206,18 +212,22 @@ class ReproducibleTests(OESelftestTestCase):
if self.save_results:
for d in result.different:
- self.copy_file(d.reference, '/'.join([save_dir, d.reference]))
- self.copy_file(d.test, '/'.join([save_dir, d.test]))
+ self.copy_file(d.reference, '/'.join([save_dir, 'packages', strip_topdir(d.reference)]))
+ self.copy_file(d.test, '/'.join([save_dir, 'packages', strip_topdir(d.test)]))
if result.missing or result.different:
fails.append("The following %s packages are missing or different: %s" %
(c, '\n'.join(r.test for r in (result.missing + result.different))))
- if fails:
- self.fail('\n'.join(fails))
-
# Clean up empty directories
if self.save_results:
if not os.listdir(save_dir):
os.rmdir(save_dir)
+ else:
+ self.logger.info('Running diffoscope')
+ runCmd(['diffoscope', '--no-default-limits', '--exclude-directory-metadata', '--html-dir', 'diff-html', 'reproducibleA', 'reproducibleB'],
+ native_sysroot=diffoscope_sysroot, ignore_status=True, cwd=os.path.join(save_dir, 'packages'))
+
+ if fails:
+ self.fail('\n'.join(fails))
--
2.23.0
next prev parent reply other threads:[~2020-02-12 3:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 3:14 [PATCH 0/4] oeqa: Run diffoscop on saved output Joshua Watt
2020-02-12 3:14 ` [PATCH 1/4] python: Add libarchive-c recipe Joshua Watt
2020-06-10 3:17 ` [OE-core] " Yu, Mingli
2020-02-12 3:14 ` [PATCH 2/4] python: Add magic recipe Joshua Watt
2020-02-12 3:14 ` [PATCH 3/4] recipes-support: Add diffoscope recipe Joshua Watt
2020-02-14 6:34 ` Khem Raj
2020-02-14 13:15 ` Joshua Watt
2020-02-14 14:18 ` Richard Purdie
2020-02-14 14:31 ` Khem Raj
2020-02-12 3:14 ` Joshua Watt [this message]
2020-02-12 3:28 ` [PATCH 0/4] oeqa: Run diffoscop on saved output akuster808
2020-02-15 11:07 ` Richard Purdie
2020-02-16 18:27 ` Joshua Watt
2020-02-17 11:02 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200212031435.792802-5-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox