[Reproducible-builds] Bug#835055: ghc test regression as provided .hi files are to tightly bound to the actual environment

Levente Polyak levente at leventepolyak.net
Sun Aug 21 18:34:31 UTC 2016

Package: diffoscope

The GHC tests are too tightly bound to a very specific ghc version (in
this case ghc and the test will fail if the HI-version
mismatche (hi magic in this case is 33214052).
In such case the diffoscope internal will select a fallback
FilesystemComperator instead of the HiFile one.

Introduced in commit 867ecde1

This is particularly a problem for future packaging of a version outside
of debian (foreign distro) as this tests will always fail leading to an
un-packagable state.

Additionally I don't think that this is very practical in its nature
because of the way haskell compiled .hi files work. They contain hashes
of the used modules (like in this case System.Posix.Time and
If those values change, the test will fail again (where maybe even the
matching ghc is indeed installed).
Maybe it should be considered to do this diffoscope unit tests in a
different way (or drop it).


haskell1 = <<class 'diffoscope.comparators.binary.FilesystemFile'>

    def test_identification(haskell1):
>       assert isinstance(haskell1, HiFile)
E       assert isinstance(<<class
/home/anthraxx/Projects/external/diffoscope/tests/data/test1.hi>, HiFile)

tests/comparators/test_haskell.py:31: AssertionError

differences = []

    def test_diff(differences):
        with open(data('haskell_expected_diff')) as f:
            expected_diff = f.read()
>       assert differences[0].unified_diff == expected_diff
E       IndexError: list index out of range

tests/comparators/test_haskell.py:44: IndexError


More information about the Reproducible-builds mailing list