[reprotest] 05/07: main, presets: Pass --exclude-directory-metadata to diffoscope(1) by default

Ximin Luo infinity0 at debian.org
Tue Sep 26 14:36:08 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 6fc8cd3a110dfdabb71b47b9ee5e55763118bbd1
Author: Ximin Luo <infinity0 at debian.org>
Date:   Tue Sep 26 15:59:50 2017 +0200

    main, presets: Pass --exclude-directory-metadata to diffoscope(1) by default
---
 README.rst              | 24 +++++++++++-------------
 debian/changelog        |  2 ++
 reprotest/__init__.py   |  5 +++--
 reprotest/presets.py    |  2 +-
 tests/test_reprotest.py |  2 +-
 5 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/README.rst b/README.rst
index e92cbe7..aebef9a 100644
--- a/README.rst
+++ b/README.rst
@@ -162,7 +162,6 @@ A sample config file is below::
 
     [diff]
     diffoscope_arg =
-      --exclude-directory-metadata
       --debug
 
 
@@ -173,19 +172,18 @@ 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
+may not be intended to be distributed to other systems. For example: (1) for
+most distros' package builders, we don't care about the metadata of the output
 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.
+the other hand, (2) when running something like `make install`, we *do* care
+about the metadata, because this is what will be recreated on another system.
+
+In developing reprotest, our experience has been that case (1) is more common
+and so we pass ``--exclude-directory-metadata`` by default to diffoscope. If
+you find that you are using reprotest for case (2) then you should pass
+``--diffoscope-args=--no-exclude-directory-metadata`` to reprotest, to tell
+diffoscope to not ignore the metadata since it will be distributed and should
+therefore be reproducible. Otherwise, you may get a false-positive result.
 
 
 Variations
diff --git a/debian/changelog b/debian/changelog
index b5abbce..e2943da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ reprotest (0.7.1) UNRELEASED; urgency=medium
     - using reprotest with default settings after not installing Recommends
   * Add a --source-pattern option to restrict copying of source_root, and set
     this automatically in our presets.
+  * Pass --exclude-directory-metadata to diffoscope(1) by default as this is
+    the majority use-case. Document the other cases in README and the man page.
 
  -- Ximin Luo <infinity0 at debian.org>  Fri, 22 Sep 2017 17:57:31 +0200
 
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 0cbb4c9..0c37631 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -507,8 +507,9 @@ def cli_parser():
     group1.add_argument('--dont-vary', default=[], action='append', help=argparse.SUPPRESS)
 
     group2 = parser.add_argument_group('diff options')
-    group2.add_argument('--diffoscope-arg', default=[], action='append',
-        help='Give extra arguments to diffoscope when running it.')
+    group2.add_argument('--diffoscope-arg', action='append',
+        help='Give extra arguments to diffoscope when running it. Default: '
+        '%(default)s', default=['--exclude-directory-metadata'])
     group2.add_argument('--no-diffoscope', action='store_true', default=False,
         help='Don\'t run diffoscope; instead run diff(1). Useful if you '
         'don\'t want to install diffoscope and/or just want a quick answer '
diff --git a/reprotest/presets.py b/reprotest/presets.py
index 564debb..ce90156 100644
--- a/reprotest/presets.py
+++ b/reprotest/presets.py
@@ -64,7 +64,7 @@ PRESET_DEB_DIR = ReprotestPreset(
     testbed_pre = None,
     testbed_init = None,
     source_pattern = None,
-    diffoscope_args = ["--exclude-directory-metadata"],
+    diffoscope_args = [],
 )
 
 def preset_deb_schroot(preset):
diff --git a/tests/test_reprotest.py b/tests/test_reprotest.py
index eaa6cd6..917074f 100644
--- a/tests/test_reprotest.py
+++ b/tests/test_reprotest.py
@@ -20,7 +20,7 @@ TEST_VARIATIONS = frozenset(VARIATIONS.keys()) - frozenset(REPROTEST_TEST_DONTVA
 
 def check_reproducibility(command, virtual_server, reproducible):
     result = reprotest.check(
-        reprotest.TestArgs.default(command, 'tests', 'artifact'),
+        reprotest.TestArgs.default(command, 'tests', 'artifact', diffoscope_args=[]),
         reprotest.TestbedArgs.default(virtual_server),
         Variations.of(VariationSpec.default(TEST_VARIATIONS)))
     assert result == reproducible

-- 
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