haskell / haddock

Haskell Documentation Tool

Home Page:www.haskell.org/haddock/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

haddock: internal error: ..Cabal.../share/doc/html/doc-index.json: openBinaryFile: does not exist

hasufell opened this issue · comments

Upon executing cabal v2-haddock --builddir=dist-docs.TTPG5l --haddock-for-hackage --enable-doc in ghcup-hs repository with ghc-9.2.6 and cabal 3.8.1.0, I get:

haddock: internal error: /home/hasufell/.cabal/store/ghc-9.2.6/Cabal-3.6.3.0-694a87f40315650fbba1948b50f641d2839f3ae8b3cdaca746ac1c0a4650d8b2/share/doc/html/doc-index.json: openBinaryFile: does not exist (No such file or directory)
Error: cabal: Failed to build documentation for ghcup-0.1.19.2.

The --haddock-options=--quickjump workaround from the cabal ticket doesn't work for me.

I also bumped into this error on cabal 3.10.1.0 and the --haddock-options=--quickjump workaround from haskell/cabal#8104 also didn't work for me.

I ended up switching back to cabal 3.6.2.0 (which is still the version recommended by ghcup), where the workaround above still works.

@pasqu4le are you using GHC 9.2 or earlier? 9.2 series is at the end of life and the Haddock-side fix (#1488) has never been ported to it, unfortunately. SO, you either stick to Cabal 3.6 on GHC 9.2 or you can elect to upgrade both the compiler and the build tool: GHC 9.4+ and Cabal 3.8+ don't seem to suffer from this issue.

Some discussion: haskell/cabal#9060 (comment)

Ah, yes, I'm indeed still using an older version of GHC.

@ulysses4ever thank you for answering and for the additional context 👍

@pasqu4le good news is that this problem will probably be fixed in the coming real soon now Cabal 3.10.2.