
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

On Fri, 2007-08-03 at 20:34 +0100, 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
* Fix tab in Cabal.cabal.
I was surprised to find that tabs are disallowed in cabal files. Is that really the intention?
Yes, since the new configurations format is layout sensitive. So tabs are disallowed in initial whitespace in cabal files that use the new features. Existing files should not be affected.
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
Yes, Thomas fixed that just now,
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 error message is now: setup: Cabal.cabal:70: Tabs used for indentation at (line,column): [(70,0),(71,1)] That was for a test case where tabs were used in two places of course. Duncan

| the error message is now: | | setup: Cabal.cabal:70: Tabs used for indentation at (line,column): | [(70,0),(71,1)] Great! It would be helpful to add "Use spaces instead". Otherwise the user might think "I know tabs are used for indentation -- I put them there". Simon

On Fri, 2007-08-03 at 20:55 +0100, Simon Peyton-Jones wrote:
| the error message is now: | | setup: Cabal.cabal:70: Tabs used for indentation at (line,column): | [(70,0),(71,1)]
Great! It would be helpful to add "Use spaces instead". Otherwise the user might think "I know tabs are used for indentation -- I put them there".
Thomas has improved it to say: + "Do not use tabs for indentation (use spaces instead)\n" + ++ " Tabs were used at (line,column): " ++ show tabs Duncan

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
* 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. /Thomas [1] .. excerpt from IRC logs for #ghc, search for "No tabs in .cabal files" http://hackage.haskell.org/trac/hackage/wiki/CabalConfigurations
participants (3)
-
Duncan Coutts
-
Simon Peyton-Jones
-
Thomas Schilling