[Haskell-cafe] Cabal's License type: MIT commented out?

Duncan Coutts duncan.coutts at googlemail.com
Thu Dec 24 06:12:55 EST 2009

On Wed, 2009-12-23 at 18:16 -0600, Tom Tobin wrote:
> I noticed on Hackage that packages that are MIT licensed show up as
> "OtherLicense".  I took a peek inside the Cabal code, and noticed that
> the License type has lines for MIT, but commented out [1]:
> > --    -- | The MIT license, similar to the BSD3. Very free license.
> > --  | MIT
> Why is this? 

The short answer is that you *can* now use "license: MIT".

When using Cabal-1.6 you will get a warning about it not being a known
license, however it will work. With Cabal-1.8 it's recognised. More
importantly, it's fine to upload to hackage (since hackage uses a recent
Cabal). One caveat: when using Cabal-1.2 (ie ghc-6.8) it will fall over
completely and the package will not be able to be built. If you run
"cabal check" then it will let you know about this and tell you that you
must use at least "cabal-version: >= 1.4" to use the MIT license (or
versioned GPL licenses).

The longer answer is that historically in the Cabal lib we had BSD4,
BSD3, GPL, LGPL as a simple enumeration and the parser used Read/Show.
Of course using Read/Show makes the parser extremely fragile. Old
versions of Cabal would fall over completely when presented with a new
member of the enumeration. In Cabal-1.4 I switched the parser to a more
liberal one. However we could not at the same time add new allowed
values because we would still break things for all users of older Cabal
versions. ghc-6.8 came with Cabal-1.2 and ghc-6.10 came with Cabal-1.6.
So before allowing new enumeration values we had to wait for the ghc-6.8
market share to reduce. So that's why it's only now with Cabal-1.8 that
the new enum values are on the known list (and thus allowed on hackage).
So that's why it will not break things for users of ghc-6.10 but will
break stuff for users of ghc-6.8.

So the reason it's there commented out in the Cabal-1.6 code you're
looking at is to remind us to uncomment it for Cabal-1.8 (which it now
is, along with the versioned (L)GPL licenses).


More information about the Haskell-Cafe mailing list