Cabal: Conditional code and dependencies

Simon Marlow simonmar at microsoft.com
Mon Jul 25 10:17:38 EDT 2005


On 25 July 2005 14:52, John Goerzen wrote:

> On 2005-07-21, Brian Smith <brianlsmith at gmail.com> wrote:
>> (b) A program requires some unix-specific code (package unix) or
>> windows-specific code (package win32) depending on what operating
>> system the program is built for.
> 
> I just ran into this problem with making MissingH work on Windows.  I
> finally wound up providing a batch file for Windows users that hacks
> the .cabal file, which then can be used to build the package on
> Windows. Ugly, but works.

We should try to avoid these sort of things, the reason being that
external tools need to slurp .cabal files, so having them be dynamic
creates problems.  The main problem I see is Visual Studio, which in a
sense is a GUI for editing .cabal files.  If the .cabal file needs
preprocessing, it means that someone using VS won't be able to load up
your library in VS.

Not saying you should have done this differently if there's no
alternative, but I just wanted to point this out as an issue.

Cheers,
	Simon


More information about the Libraries mailing list