Cabal bug

Thomas Schilling nominolo at
Fri Aug 3 17:45:13 EDT 2007

On 3 aug 2007, at 21.34, Simon Peyton-Jones wrote:

> I have not been following the recent work on Cabal, but I tried to  
> build in the gap before this patch was committed.  I
> Fri Aug  3 18:57:01 GMT Daylight Time 2007  Thomas Schilling  
> <nominolo at>
>   * Fix tab in Cabal.cabal.
> I was surprised to find that tabs are disallowed in cabal files.   
> Is that really the intention?  It seems like a pitfall for the  
> unwary!  At the very least, if they must be disallowed, could the  
> error message be more informative?  At the moment we get
>                 Setup.exe: Cabal.cabal:70: Unrecognized field  
> format: 'Distribution.Simple.SetupWrapper,'
> It’d be better to get
>                 Setup.exe: Cabal.cabal:70: illegal tab character:  
> replace with spaces
The problem is, that with conditional statements in .cabal files we  
really want to allow indenting the field values, e.g.,

if os(linux) {
   field: value
} else {
   other-field: value
                continuation of field value.

Therefore, we had to change the rule for multiline field values to:

   "To continue a field value, indent the next line _relative to the  
field name_."
   (emphasis added)

This, unfortunately, made .cabal files susceptible to tab-length.  My  
initial fix (defining tabs to be 8 spaces wide) was rejected[1], and  
I implemented this (backwards compatible) fix instead.

Most (decent) editors can be configured to always use spaces instead  
of tabs.


[1] .. excerpt from IRC logs for #ghc, search for "No tabs in .cabal  

More information about the Libraries mailing list