Network.URI - MIN_VERSION_base problem, or finger-trouble?

Edward Kmett ekmett at gmail.com
Tue Jan 1 17:18:15 CET 2013


On Tue, Jan 1, 2013 at 9:19 AM, Herbert Valerio Riedel <hvr at gnu.org> wrote:

> Daniel Fischer <daniel.is.fischer at googlemail.com> writes:
>
>
> [...]
>
> > When hacking on a package without using cabal, you can
> >
> > a) remove the problematic macro
> > b) define it in the file yourself
> > c) pass -D"MIN_VERSION_base(x,y,z)=1" on the command line
>
> what about mimicking what cabal does, e.g. create a CPP file
> (e.g. 'cabal_macros.h') with the needed definitions and call ghc(i)
> something along the lines of
>
>   ghci -optP-include -optPcabal_macros.h TheModule.hs
>
>
We do a mixture of these things in lens.

We set up

#ifndef MIN_VERSION_foo
#define MIN_VERSION_foo(x,y,z) 1
#endif

guards for each MIN_VERSION_foo macro used within a model for development
in case the user hasn't configured, and we set them to sensible defaults,
(aka whatever works for me), and we have a .ghci file in the repository,
that works once it has been configured and which helps support doctests and
ghci users with:

:set -isrc -idist/build/autogen -optP-include
-optPdist/build/autogen/cabal_macros.h
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130101/99003197/attachment.htm>


More information about the Libraries mailing list