Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup.lhs problem with absent cabal-doctest #721

Closed
duog opened this issue Apr 5, 2017 · 5 comments
Closed

Setup.lhs problem with absent cabal-doctest #721

duog opened this issue Apr 5, 2017 · 5 comments

Comments

@duog
Copy link
Contributor

duog commented Apr 5, 2017

I ran into an error in Setup.lhs, where MIN_VERSION_cabal_doctest was undefined. This triggered the #ifdef that seems to be a copy/paste of parts of
https://github.com/phadej/cabal-doctest/blob/master/src/Distribution/Extra/Doctest.hs
However generateBuildModule as defined in Setup.lhs takes 3 parameters, but is called elsewhere in Setup.lhs with 4 parameters. The version in cabal-doctest takes 4 parameters, so I guess you need to redo your copy/paste.

@duog duog changed the title Setup.lhs problem with of cabal-doctest Setup.lhs problem with absent cabal-doctest Apr 5, 2017
@RyanGlScott
Copy link
Collaborator

A little more detail would appreciated, as I have no idea what the error you're referring to is. What steps do you need to perform to reproduce this? Including versions of GHC/build tools would be helpful as well.

@duog
Copy link
Contributor Author

duog commented Apr 6, 2017

I am experiencing a type error at https://github.com/ekmett/lens/blob/master/Setup.lhs#L187 when trying to cabal configure on lens master branch. I am using GHC head, or close to it.

MIN_VERSION_cabal_doctest(1,0,0) is 0 for whatever reason, I am sure that's a problem in my environment somewhere.
Hence the CPP in Setup.lhs causes generateBuildModule to be defined at https://github.com/ekmett/lens/blob/master/Setup.lhs#L64 rather than to be imported from cabal-doctest. However the defintions in Setup.lhs and cabal-doctest differ in their arity. generateBuildModule is called with 4 parameters, but defined with 3, boom.

@duog
Copy link
Contributor Author

duog commented Apr 6, 2017

I don't have a dev environment on me to check a reproduction right now, but if you can remove cabal-doctest from your package database and cabal configure that would do it. You might have to use a version of cabal-install that doesn't know about setup-depends.

@duog
Copy link
Contributor Author

duog commented Apr 6, 2017

I see that ekmetts other packages do a similar thing, but they define generateBuildModule with 4 parameters. Compare:
https://github.com/ekmett/comonad/blob/master/Setup.lhs#L59
https://github.com/ekmett/lens/blob/master/Setup.lhs#L64

@RyanGlScott
Copy link
Collaborator

Ah, very nice catch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants