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…

1 Like

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-2.7.2.2 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/unix-2.7.2.2 -lrt -lutil -ldl -lpthread -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/time-1.11.1.1 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/time-1.11.1.1 -L/home/builder/builder-dir/build-cache/tmp-install/lib/x86_64-linux-ghc-9.2.4/psx-0.1.1.0-G2UZc4IGcTaHlD2gZaUEA1 -Wl,-R,/home/builder/builder-dir/build-cache/tmp-install/lib/x86_64-linux-ghc-9.2.4/psx-0.1.1.0-G2UZc4IGcTaHlD2gZaUEA1 -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-2.5.0.2 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/stm-2.5.0.2 -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-0.5.6.2 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/transformers-0.5.6.2 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/bytestring-0.11.3.1 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/bytestring-0.11.3.1 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/template-haskell-2.18.0.0 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/template-haskell-2.18.0.0 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/pretty-1.1.3.6 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/pretty-1.1.3.6 -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-1.4.6.1 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/deepseq-1.4.6.1 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/array-0.5.4.0 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/array-0.5.4.0 -L/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/base-4.16.3.0 -Wl,-R,/home/builder/.ghcup/ghc/9.2.4/lib/ghc-9.2.4/base-4.16.3.0 -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?

2 Likes

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?

1 Like

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.

1 Like

Using the haskell:9.2-slim container image from docker.io, 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!

2 Likes

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.

3 Likes

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)

3 Likes