yav / pretty-show

Tools for working with derived Show instances in Haskell.
MIT License
57 stars 15 forks source link

Dependancy Missing #22

Closed fubuloubu closed 7 years ago

fubuloubu commented 7 years ago

pretty-show-1.6.13 depends on happy-1.19.8 when installing from Cabal, but this is not listed in the required dependencies. I traced this error while trying to install pandoc-citeproc from scratch for a non-haskell project.

yav commented 7 years ago

The dependency on happy is listed in the build-tools section of the Cabal file.

Or did you mean that we are depending on that specific version of happy? If that's the case, could you please post the error you got, so I can see how to fix it.

jgpacker commented 7 years ago
Configuring pretty-show-1.6.13...
setup-Simple-Cabal-1.22.5.0-x86_64-linux-ghc-7.10.3: The program 'happy' is
required but it could not be found.

I think I got the same error

jgpacker commented 7 years ago

Oddly, it worked after I manually installed the happy package i.e. sudo cabal install happy

fubuloubu commented 7 years ago

Yeah, I don't think that specific version but cabal doesn't list it for whatever reason

fubuloubu commented 7 years ago

I.e. same message as above

yav commented 7 years ago

I see. The issue here is with Cabal---dependencies on external tools are not build automatically, instead it just throws an error, and you have to install them manually. There is a fairly in-depth discussion of this issue here: https://github.com/haskell/cabal/issues/220

It looks like the latest Cabal does have a new pragma build-tool-depends, which will auto-build tool packages as long as you use the Nix-style new-build command. I just pushed a tweak to the cabal file, that adds this pragma.

Unfortunately, this would not help if you are using an older Cabal, or just the standard build mode (which is probably the case for most users, currently) and you'd still have to install the happy dependency manually.