#1120355 dh-haskell: Builds different binary packages when nocheck specified

#1120355#5
Date:
2025-11-07 23:21:29 UTC
From:
To:
Hi,

I'm not at all sure whether this is actually dh-haskell's fault, but
whilst working on the Reproducible Builds effort [0], I noticed that
Haskell packages are building different binaries depending on whether
"nocheck" is specified. (I'm filing it here because it seems like the
first step.)

For instance, when I build the haskell-integer-logarithms package and
I run the testsuite (ie. I don't specify "nocheck"), I get the following:

  283de3b00123c50ff754a7b7501e52efd9c8bdb9  libghc-integer-logarithms-dev_1.0.3.1-4_amd64.deb

However, when I do specify "nocheck", I get the following:

  df5c67f1d255d04d4fcc803b30088fdd08d69481  libghc-integer-logarithms-dev_1.0.3.1-4_amd64.deb

These results are determinstic — ie. I get the same two SHAs if I repeat
the 'check' and nocheck builds.

I wonder if this is an ABI hash issue; GHC is calculating a different
hash because of the code/symbols of the testsuite part?

https://tests.reproducible-builds.org/debian/dbdtxt/unstable/amd64/haskell-integer-logarithms_1.0.3.1-4.diffoscope.txt.gz

Indeed, poking some more makes me think the issue is not with dh-haskell,
which is AFAICT simply passing --enable-tests?

Your help appreciated. :)


Patch attached.

  [0] https://reproducible-builds.org/


Regards,

#1120355#10
Date:
2025-11-08 02:32:40 UTC
From:
To:
It seems very likely this is a ghc bug.  You can see things go wrong
during the configure step where the interface hash is already different.
It seems like either the configure flags are being incorporated into the
interface hash, and/or the test files are.

(without tests):
Running debian/hlibrary.setup configure --ghc -v2
--package-db=/var/lib/ghc/package.conf.d --prefix=/usr 
--libdir=/usr/lib/haskell-packages/ghc/lib --libexecdir=/usr/lib 
--builddir=dist-ghc --ghc-option=-optl-Wl,-z,relro 
--haddockdir=/usr/lib/ghc-doc/haddock/integer-logarithms-1.0.3.1/ 
--datasubdir=integer-logarithms 
--htmldir=/usr/share/doc/libghc-integer-logarithms-doc/html/ 
--enable-library-profiling
Using Parsec parser
Configuring integer-logarithms-1.0.3.1...
Flags chosen: check-bounds=False, integer-gmp=True
Dependency array >=0.3 && <0.6: using array-0.5.6.0
Dependency base >=4.15 && <4.19: using base-4.18.2.1
Dependency ghc-bignum >=1.0 && <1.4: using ghc-bignum-1.3
Dependency ghc-prim <0.11: using ghc-prim-0.10.0
Source component graph: component lib
Configured component graph:
     component integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn
         include array-0.5.6.0
         include base-4.18.2.1
         include ghc-bignum-1.3
         include ghc-prim-0.10.0
Linked component graph:
     unit integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn
         include array-0.5.6.0
         include base-4.18.2.1
         include ghc-bignum-1.3
         include ghc-prim-0.10.0

GHC.Integer.Logarithms.Compat=integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn:GHC.Integer.Logarithms.Compat,Math.NumberTheory.Logarithms=integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn:Math.NumberTheory.Logarithms,Math.NumberTheory.Powers.Integer=integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn:Math.NumberTheory.Powers.Integer,Math.NumberTheory.Powers.Natural=integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn:Math.NumberTheory.Powers.Natural
Ready component graph:
     definite integer-logarithms-1.0.3.1-6uUFCUhH0MHDrcFfWqxKEn
         depends array-0.5.6.0
         depends base-4.18.2.1
         depends ghc-bignum-1.3
         depends ghc-prim-0.10.0

===
(with tests):
Running debian/hlibrary.setup configure --ghc -v2
--package-db=/var/lib/ghc/package.conf.d --prefix=/usr 
--libdir=/usr/lib/haskell-packages/ghc/lib --libexecdir=/usr/lib 
--builddir=dist-ghc --ghc-option=-optl-Wl,-z,relro 
--haddockdir=/usr/lib/ghc-doc/haddock/integer-logarithms-1.0.3.1/ 
--datasubdir=integer-logarithms 
--htmldir=/usr/share/doc/libghc-integer-logarithms-doc/html/ 
--enable-library-profiling --enable-tests
Using Parsec parser
Configuring integer-logarithms-1.0.3.1...
Flags chosen: check-bounds=False, integer-gmp=True
Dependency array >=0.3 && <0.6: using array-0.5.6.0
Dependency base >=4.15 && <4.19: using base-4.18.2.1
Dependency ghc-bignum >=1.0 && <1.4: using ghc-bignum-1.3
Dependency ghc-prim <0.11: using ghc-prim-0.10.0
Dependency QuickCheck >=2.14.1 && <2.15: using QuickCheck-2.14.3
Dependency base: using base-4.18.2.1
Dependency integer-logarithms: using integer-logarithms-1.0.3.1
Dependency smallcheck >=1.2 && <1.3: using smallcheck-1.2.1.1
Dependency tasty >=0.10 && <1.5: using tasty-1.4.3
Dependency tasty-hunit >=0.9 && <0.11: using tasty-hunit-0.10.2
Dependency tasty-quickcheck >=0.8 && <0.11: using tasty-quickcheck-0.10.2
Dependency tasty-smallcheck >=0.8 && <0.9: using tasty-smallcheck-0.8.2
Source component graph:
     component lib
     component test:spec dependency lib
Configured component graph:
     component integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM
         include array-0.5.6.0
         include base-4.18.2.1
         include ghc-bignum-1.3
         include ghc-prim-0.10.0
     component integer-logarithms-1.0.3.1-4KAoeVaXVaeBOviwt5ev8j-spec
         include QuickCheck-2.14.3-2ib5howz5bF8WgkuPDgHew
         include base-4.18.2.1
         include integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM
         include smallcheck-1.2.1.1-E2eADYOypqNJRujnynoHmE
         include tasty-1.4.3-DjIfIDR22Q9BNTJumlm9d
         include tasty-hunit-0.10.2-5JeOukpggCxmW3MfPokrE
         include tasty-quickcheck-0.10.2-6OeG3255EPd8u3vF5G7ss7
         include tasty-smallcheck-0.8.2-8QDOjGkOwps3rXr7O5Jq3j
Linked component graph:
     unit integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM
         include array-0.5.6.0
         include base-4.18.2.1
         include ghc-bignum-1.3
         include ghc-prim-0.10.0

GHC.Integer.Logarithms.Compat=integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM:GHC.Integer.Logarithms.Compat,Math.NumberTheory.Logarithms=integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM:Math.NumberTheory.Logarithms,Math.NumberTheory.Powers.Integer=integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM:Math.NumberTheory.Powers.Integer,Math.NumberTheory.Powers.Natural=integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM:Math.NumberTheory.Powers.Natural
     unit integer-logarithms-1.0.3.1-4KAoeVaXVaeBOviwt5ev8j-spec
         include QuickCheck-2.14.3-2ib5howz5bF8WgkuPDgHew
         include base-4.18.2.1
         include integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM
         include smallcheck-1.2.1.1-E2eADYOypqNJRujnynoHmE
         include tasty-1.4.3-DjIfIDR22Q9BNTJumlm9d
         include tasty-hunit-0.10.2-5JeOukpggCxmW3MfPokrE
         include tasty-quickcheck-0.10.2-6OeG3255EPd8u3vF5G7ss7
         include tasty-smallcheck-0.8.2-8QDOjGkOwps3rXr7O5Jq3j
Ready component graph:
     definite integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM
         depends array-0.5.6.0
         depends base-4.18.2.1
         depends ghc-bignum-1.3
         depends ghc-prim-0.10.0
     definite integer-logarithms-1.0.3.1-4KAoeVaXVaeBOviwt5ev8j-spec
         depends QuickCheck-2.14.3-2ib5howz5bF8WgkuPDgHew
         depends base-4.18.2.1
         depends integer-logarithms-1.0.3.1-5PM6hhkL1LLFKyDT6DncqM
         depends smallcheck-1.2.1.1-E2eADYOypqNJRujnynoHmE
         depends tasty-1.4.3-DjIfIDR22Q9BNTJumlm9d
         depends tasty-hunit-0.10.2-5JeOukpggCxmW3MfPokrE
         depends tasty-quickcheck-0.10.2-6OeG3255EPd8u3vF5G7ss7
         depends tasty-smallcheck-0.8.2-8QDOjGkOwps3rXr7O5Jq3j

===

Regards,
Scott

#1120355#19
Date:
2026-01-08 17:56:17 UTC
From:
To:
Hi Chris,

* Chris Lamb <chris@reproducible-builds.org> [2026-01-08 09:43]:

I note that you filled #1120355 in November against dh-haskell 0.6.11b,
whereas parallel support was only added with 0.6.12 in December.

For completeness, Clint pointed at parallel support in IRC.

Cheers Jochen

#1120355#24
Date:
2026-01-08 17:43:35 UTC
From:
To:
Jochen Sprickerhof wrote:

Oh, well diagnosed :)  I had filed a placeholder bug tracking this issue
at #1120355, but as it was re-assigned to src:ghc I'll let the Haskell
maintainers decide whether they would find value in keeping this open.


Best wishes,