Troubleshooting Hackage doc build failures

The Hackage builder seems to be unable to auto-build the docs of a package I maintain. For now, I uploaded the docs manually, but I’d prefer to have Hackage do this for me when publishing a new version.

Hence, any pointers at how I can debug/troubleshoot why the package isn’t picked up for building? Some other packages I uploaded are being built, and their docs are being published automatically…

I don’t know why the hackage builder failed to upload that specific log for inspection. I poked around on the builder and found the error recorded:

linking dist/build/landlock-internal/System/Landlock/Hsc_hsc_make.o failed (exit code 1)
rsp file was: "dist/build/landlock-internal/System/Landlock/hsc2hscall1661015-2.rsp"
command was: /usr/bin/gcc dist/build/landlock-internal/System/Landlock/Hsc_hsc_make.o dist/build/landlock-internal/System/Landlock/Hsc_hsc_utils.o -o dist/build/landlock-internal/System/Landlock/Hsc_hsc_make -fuse-ld=gold -fuse-ld=gold -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/unix- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/unix- -lrt -lutil -ldl -lpthread -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/time- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/time- -L/home/builder/builder-dir/build-cache/tmp-install/lib/x86_64-linux-ghc-9.2.4/psx- -Wl,-R,/home/builder/builder-dir/build-cache/tmp-install/lib/x86_64-linux-ghc-9.2.4/psx- -Wl,-wrap,sigfillset -Wl,-undefined,__wrap_sigfillset -pthread -Wl,-wrap,pthread_create -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/exceptions-0.10.4 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/exceptions-0.10.4 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/stm- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/stm- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/mtl-2.2.2 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/mtl-2.2.2 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/transformers- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/transformers- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/bytestring- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/bytestring- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/template-haskell- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/template-haskell- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/pretty- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/pretty- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/ghc-boot-th-9.2.4 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/ghc-boot-th-9.2.4 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/deepseq- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/deepseq- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/array- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/array- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/base- -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/base- -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/ghc-bignum-1.2 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/ghc-bignum-1.2 -lgmp -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/ghc-prim-0.8.0 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/ghc-prim-0.8.0 -lc -lm -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/rts -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/rts -lm -lrt -ldl -lpthread
error: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(generic-morestack.o):function __generic_morestack_set_initial_sp: error: undefined reference to '__wrap_sigfillset'
collect2: error: ld returned 1 exit status

my guess is this requires some library or module installed which is not on the builder?

1 Like

Thank you for the pointer! Indeed, it looks like an issue with the (fairly old) build env. Does this happen to run in some container so it can be easily reproduced (and fixed) locally?

Another, somewhat related, question: for another package, docs building does seem to succeed, but Hackage reports “Docs uploaded by user”, which ain’t true, I most definitely did not upload the docs. Oddly enough, the “Build status” of said package is (also) unknown (no reports yet), however, when following the no reports yet link, it does say Status: Built successfully, even though No reports available.

Comparing this to another package, where it does say Docs available (so, not “uploaded by user”), with a build log, and the package gets a “Build InstallOK” badge, and there is a (successful) build report, this is quite confusing.

Using the haskell:9.2-slim container image from, which also comes with an old GCC toolchain, I was able to reproduce the error, so should find a way to fix it. Thanks again!

1 Like

Digging into this further, I actually believe this is a bug in Cabal, hence I filed `ld-options` are passed to GCC when linking hsc2hs object files · Issue #8824 · haskell/cabal · GitHub

It looks like Cabal links the hsc2hs generator executable using whichever ld-options are specified by build-depends of the stanza which contains some hsc file. This seems incorrect: why should it? hsc2hs generates a C file which doesn’t use any of these build-depends and can be compiled/linked with, basically, only libc around.


For some reason the built docs uploaded successfully, but the report did not. Not sure why! Interesting issue to try to debug though… (in the past this has had to do with parser errors that could occur on generated build reports)