haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 691 forks source link

cabal new-haddock --ghcjs fails to build #5840

Open harendra-kumar opened 5 years ago

harendra-kumar commented 5 years ago

When building with ghcjs, haddock build fails. To reproduce use the following command in https://github.com/composewell/streamly repo:

cabal new-haddock --project-file cabal.project.ghcjs

This is the error produced ultimately:

Haddock's resource directory does not exist!

Warning: Failed to build documentation for streamly-0.6.0.

This same issue occurs when building the ghcjs compiler itself as well using cabal new-build. See ghcjs/ghcjs#653 .

harpocrates commented 5 years ago

The Haddock error means that something in Haddock's installation went wrong. Cabal isn't really at fault, unless it was behind the installation of the Haddock binary too.

How does one install ghcjs? How are binaries built? GHC generates a wrapper for Haddock (so as to specify the right resource directory) on installation, perhaps ghcjs needs to do that too?

hvr commented 5 years ago

@harendra-kumar Just for the record, I didn't pay much attention to haddock support in my GHCJS PPA packaging yet, so it's quite likely it isn't properly packaged yet.

@harpocrates Unfortunately installing ghcjs is not as straightforward as installing a ghc, especially if you want to make it look like an ordinary GHC installation that isn't tied to $HOME. That's been the major reason why it took me so long to provide packaging for GHCJS.