Bug#969958: haskell-haskell-gi-base: please make the build reproducible (non-deterministic enumeration values)

Chris Lamb lamby at debian.org
Wed Sep 9 11:04:57 BST 2020


Source: haskell-haskell-gi-base
Version: 0.23.0-1
Severity: wishlist
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] I noticed that
haskell-haskell-gi-base could not be built reproducibly.

I believe this occurs because the value of gtypeError in
Data/GI/Base/GType.hsc appears to be non-deterministic.

It is actually easier to see in the generated documentation, but it is
reflected in the code/binaries itself, and then in the varying
interface hashes and even the varying "Provides" of the binary package
itself:

│ │ │ │ -Provides: libghc-haskell-gi-base-dev-0.24.2-9bec6
│ │ │ │ +Provides: libghc-haskell-gi-base-dev-0.24.2-19256

Again, this is just a downstream effect of the root cause; simply fixing
or removing this is fixing the wrong thing.

This may even be demonstrating a larger problem in the package as you
might not be able to link (??) against the package as it will always
have a different interface hash. Alas, I'm not a GHC person.

Poking around, the following comment in GType.hsc appears to be highly
relevant:

   32 {-| [Note: compile-time vs run-time GTypes]
   33
   34 Notice that there are two types of GType's: the fundamental ones,
   35 which are created with G_TYPE_MAKE_FUNDAMENTAL(n) and always have the
   36 same runtime representation, and the ones that are registered in the
   37 GObject type system at runtime, and whose `CGType` may change for each
   38 program run (and generally does).
   39
   40 For the first type it is safe to use hsc to read the numerical values
   41 of the CGType at compile type, but for the second type it is essential
   42 to call the corresponding _get_type() function at runtime, and not use
   43 the value of the corresponding "constant" at compile time via hsc.
   44 -}

Hopefully this should be straightforward for something steeped in GLib lore
to understand and fix.

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


Regards,

--
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-



More information about the Pkg-haskell-maintainers mailing list