#26 Haskell library documentation is not reproducible
Opened by jelly. Modified

Small excerpt from ghc-aeson:

│ │ --rw-r--r--   1        0        0   597273 2025-02-24 00:00:00.000000 ./usr/share/doc/ghc/html/libraries/witherable-0.5/src/Witherable.html
│ │ +-rw-r--r--   1        0        0   613653 2025-02-24 00:00:00.000000 ./usr/share/doc/ghc/html/libraries/witherable-0.5/src/Witherable.html
  -</span><a href="#local-1627466838"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">t a
│  -</span><a href="#local-1627466839"><span class="hs-identifier hs-var">xs</span></a></span><span>  +</span><a href="#local-6989586621679086687"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">t a
│  +</span><a href="#local-6989586621679086688"><span class="hs-identifier hs-var">xs</span></a></span><span>

Debian does not seem to have an issue but also seems to pass --hyperlink-source to haddock as Fedora.

Grabbing a haskell library without any build dependencies and installing ghc reproduces the issue quite easily:

haddock src/Data/BinaryWord.hs --odir foo --html
haddock src/Data/BinaryWord.hs --odir bar --html
diffoscope foo bar

Only shows creation time differences, but with --hyperlinked-source the hyperlinks with <a href="#local-6989586621679028624"> are added to the html output.

This can't be reproduced by running haddock twice nor two fedpkg mockbuild invocations so something on the host might influence the uid generation?

haddock src/Data/BinaryWord.hs --odir foo --html --hyperlinked-source
haddock src/Data/BinaryWord.hs --odir bar --html --hyperlinked-source
diffoscope foo bar

Source code of haddock is located here.


Haskell upstream is aware of the issue and is working on it. Some links were posted on the mailing list a while ago…

Metadata Update from @zbyszek:
- Issue tagged with: irreproducibility

Haskell upstream is aware of the issue and is working on it. Some links were posted on the mailing list a while ago…

Is that the reproducible builds mailing list or fedora-devel one? I'm happy to dig into it but I also noticed that the haddock build docs are reproducible in Debian so this made me create the issue to figure out if it is a Fedora specific build flag or lack of.

(From the top of my head I recall that Debian builds with -j1 so that could be the reason).

https://gitlab.haskell.org/ghc/ghc/-/issues/12935 is the general tracking issue. I'm not sure if the problems we're seeing here are covered by one of the issues linked there.

The documentation anchor is generated here and it seems that it is not guaranteed to be stable.

https://gitlab.haskell.org/ghc/ghc/-/issues/26119

The issue appears to be solved in ghc 1.12.2. We should have it in Fedora sometime next year. Let's leave this open for verification, but otherwise the issue is most likely solved.

Follow-up: https://gitlab.haskell.org/ghc/ghc/-/issues/26125

Metadata