haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
361 stars 243 forks source link

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

Closed hasufell closed 2 months ago

hasufell commented 1 year ago

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.
hasufell commented 1 year ago

https://github.com/commercialhaskell/stack/issues/5694

hasufell commented 1 year ago

https://github.com/haskell/cabal/issues/8104

hasufell commented 1 year ago

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

pasqu4le commented 1 year ago

I also bumped into this error on cabal 3.10.1.0 and the --haddock-options=--quickjump workaround from https://github.com/haskell/cabal/issues/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.

ulysses4ever commented 1 year ago

@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: https://github.com/haskell/cabal/issues/9060#issuecomment-1604374404

pasqu4le commented 1 year ago

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

@ulysses4ever thank you for answering and for the additional context :+1:

ulysses4ever commented 1 year ago

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

jtdaugherty commented 8 months ago

I'm running into this issue now with brick-2.1. Hackage isn't building the docs for that release, and when I try to do it locally in order to upload to Hackage, I get the error that resulted in this ticket. I'm using GHC 9.2.7 and cabal-install 3.10.2.0 (Cabal 3.10.2.1). Any recommendations for what I can do to resolve this in my situation?

ulysses4ever commented 8 months ago

@jtdaugherty https://github.com/haskell/haddock/issues/1582#issuecomment-1611412223

hasufell commented 8 months ago

@jtdaugherty yeah, you can upgrade to GHC 9.4 and then deal with all the clang fallout on windows.