[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33922: failing git-annex build

From: Timothy Sample
Subject: bug#33922: failing git-annex build
Date: Wed, 02 Jan 2019 17:14:38 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)


Ricardo Wurmus <address@hidden> writes:

> [...]
> It seems to me that this is a more general problem affecting all of our
> Haskell packages.  The configure phase that you didn’t paste should show
> that modules are provided by slightly different packages.
> The haskell-build-system suffers from non-determinism.  It might just be
> limited to the package database files that are generated by ghc-pkg
> (where readdir is used and the result isn’t sorted).

This is exactly the problem.  I’ve attached a patch that should fix
this.  Unfortunately, I kind of rediscovered this from scratch, so for
the sake of completeness, here’s all the details of what I found.

I don’t recall the exact chain of dependencies that led me from
git-annex to ghc-exceptions, but the latter is a nice and small example
of the general problem.  The ghc-exceptions package depends on ghc-stm.
Even though Hydra and Berlin built the exact same ghc-stm (save for the
“package.cache” file), the way that ghc-exceptions depends on it differs
between build servers.  Hydra uses “stm-[version]” in the ghc-exceptions
package database, and Berlin uses “stm-[version]-[hash]”.  For more
complicated packages, these differences get sufficiently jumbled up and
GHC gets grumpy because we are trying to use two “different” versions of
ghc-stm.  In this case, they both have the same name, ID, ABI, and are
even bit-for-bit identical (again, except for “package.cache”), but GHC
doesn’t care because it is worried about the different reference (with
the hash and without it).

Another concrete example is ghc-aeson.  It needs (among other things)
ghc-uuid-types and ghc-hashable.  These both need ghc-text.  Right now,
I cannot build ghc-aeson because it has conflicting requirements for
ghc-text.  It looks like I got a ghc-uuid-types substitute from Hydra
that doesn’t include the hash, and a ghc-hashable substitute from Berlin
that does.  Again, ghc-text is bit-for-bit identical between the two up
to “package.cache”.

What’s great is that both build servers are internally consistent, so
they never run into trouble.  It’s just us poor users that suffer.  :p

Obviously the “package.cache” file looks pretty guilty, but it is also
pretty inscrutable.  I pulled code out of GHC to dump a textual
representation of it, and found out that the only differences are in the
order of packages.  Everything else is the same.

I modified 'ghc-pkg' to write a sorted binary cache, and it seems to
solve all the issues mentioned above.  That is, I built ghc-text,
ghc-hashable, and ghc-uuid-types on two different computers, and got
bit-for-bit identical results for all of them.  (I also built ghc-text
on both computers without the patch, and saw the same differing
“package.cache” problem that I observed between Hydra and Berlin.)

I think this patch will solve the git-annex problem, as well improve
Haskell reproducibility.


-- Tim

Attachment: 0001-gnu-ghc-Sort-packages-before-writing-binary-cache.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]