[reprotest] 01/02: Document --diffoscope-args=--exclude-directory-metadata and use it in presets

Ximin Luo infinity0 at debian.org
Wed Jul 12 12:39:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository reprotest.

commit 2d246c83324151b9111ee5bb8e0aa349e485f3fd
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Jul 12 14:36:15 2017 +0200

    Document --diffoscope-args=--exclude-directory-metadata and use it in presets
---
 README.rst            | 22 ++++++++++++++++++++++
 debian/changelog      |  8 ++++++++
 debian/control        |  2 +-
 reprotest/__init__.py |  2 ++
 reprotest/presets.py  | 14 ++++++--------
 setup.py              |  2 +-
 6 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/README.rst b/README.rst
index 69b0617..a4be817 100644
--- a/README.rst
+++ b/README.rst
@@ -166,6 +166,28 @@ A sample config file is below.
       umask
 
 
+Analysing diff output
+=====================
+
+Normally when diffoscope compares directories, it also compares the metadata of
+files in those directories - file permissions, owners, and so on.
+
+However depending on the circumstance, this filesystem-level metadata may or
+may not be intended to be distributed to other systems. For example: for most
+distros' package builders, we don't care about the metadata of the resulting
+package files; only the file contents will be distributed to other systems. On
+the other hand, when running something like `make install`, we *do* care about
+the metadata, because this is what will be recreated on another system.
+
+In the first case (where only the file contents will be distributed) you should
+pass ``--diffoscope-args=--exclude-directory-metadata`` to reprotest, to tell
+diffoscope to ignore the metadata that will not be distributed. Otherwise, you
+may get a false-negative result on the reproducibility of your build.
+
+This flag is already set in our presets, in the situations where it is
+appropriate to do so.
+
+
 Known bugs
 ==========
 
diff --git a/debian/changelog b/debian/changelog
index aab5234..3fa9320 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+reprotest (0.6.3) UNRELEASED; urgency=medium
+
+  * Document when one should use --diffoscope-args=--exclude-directory-metadata
+    and do this in our Debian package presets.
+  * Bump diffoscope Recommends version to >= 84 to support this flag.
+
+ -- Ximin Luo <infinity0 at debian.org>  Wed, 12 Jul 2017 13:53:05 +0200
+
 reprotest (0.6.2) unstable; urgency=medium
 
   * Add a documentation section on "Known bugs".
diff --git a/debian/control b/debian/control
index 21237dd..bcf894d 100644
--- a/debian/control
+++ b/debian/control
@@ -37,7 +37,7 @@ Depends: ${python3:Depends},
  procps,
  python3-pkg-resources,
  ${misc:Depends}
-Recommends: diffutils | diffoscope, disorderfs, locales-all, faketime
+Recommends: diffutils | diffoscope (>= 84), disorderfs, locales-all, faketime
 Suggests: autodep8, schroot, qemu-system, qemu-utils
 Description: Build software and check it for reproducibility.
  reprotest builds the same source code twice in different environments, and
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 1ede046..5e0842d 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -716,6 +716,8 @@ def main():
         artifact = values.artifact
         testbed_pre = values.testbed_pre
         testbed_init = values.testbed_init
+        if diffoscope_args is not None:
+            diffoscope_args = values.diffoscope_args + diffoscope_args
 
     # print(build_command, artifact, virtual_server_args)
     return check(build_command, artifact, virtual_server_args, source_root,
diff --git a/reprotest/presets.py b/reprotest/presets.py
index f77f6be..1f9691f 100644
--- a/reprotest/presets.py
+++ b/reprotest/presets.py
@@ -13,7 +13,7 @@ class AttributeFunctor(collections.namedtuple('_AttributeFunctor', 'x f')):
 
 
 class ReprotestPreset(collections.namedtuple('_ReprotestPreset',
-    'build_command artifact testbed_pre testbed_init')):
+    'build_command artifact testbed_pre testbed_init diffoscope_args')):
     """Named-tuple representing a reprotest command preset.
 
     You can manipulate it like this:
@@ -60,7 +60,8 @@ PRESET_DEB_DIR = ReprotestPreset(
     build_command = 'dpkg-buildpackage -uc -us -b',
     artifact = '../*.deb',
     testbed_pre = None,
-    testbed_init = None
+    testbed_init = None,
+    diffoscope_args = ["--exclude-directory-metadata"],
 )
 
 def preset_deb_schroot(preset):
@@ -72,12 +73,9 @@ def preset_deb_schroot(preset):
     )
 
 def preset_deb_dsc(fn):
-    return ReprotestPreset(
-        build_command = 'dpkg-source -x "%s" build && cd build && dpkg-buildpackage -uc -us -b' % fn,
-        artifact = '*.deb',
-        testbed_pre = None,
-        testbed_init = None
-    )
+    return PRESET_DEB_DIR.prepend.build_command(
+            'dpkg-source -x "%s" build && cd build && ' % fn
+        ).set.artifact("*.deb")
 
 def get_presets(buildfile, virtual_server):
     fn = os.path.basename(buildfile)
diff --git a/setup.py b/setup.py
index b59aeae..3cffa00 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@
 from setuptools import setup, find_packages
 
 setup(name='reprotest',
-      version='0.6.2',
+      version='0.6.3',
       description='Build packages and check them for reproducibility.',
       long_description=open('README.rst', encoding='utf-8').read(),
       author='Ceridwen',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git



More information about the Reproducible-commits mailing list