Bug in Cabal creating user package.conf

Isaac Jones ijones at syntaxpolice.org
Sat Apr 30 03:40:39 EDT 2005

Ashley Yakeley <ashley at semantic.org> writes:

> I don't know if this has already been mentioned, but there's a bug in 
> Cabal which I noticed when I tried to configure a package:
>   $ runghc Setup.hs configure
>   ...
>   configure: Reading installed packages...
>   cannot parse package list
> It turns out Setup created a user package.conf consisting of the two 
> characters "[]" without a newline, which it was then unable to parse. 
> Adding a newline fixed the problem.

Hmm.  How sure are you that it was cabal that created the package.conf
file?  This is the code that does so, and it definitely seems to add a

-- |If the package file doesn't exist, we should try to create it.  If
-- it already exists, do nothing and return true.  This does not take
-- into account whether it is readable or writeable.
maybeCreateLocalPackageConfig :: IO Bool  -- ^success?
    = do f <- localPackageConfig
         exists <- doesFileExist f
         unless exists $ (try (writeFile f "[]\n") >> return ())
         doesFileExist f

What platform are you using?  Is this a DOS vs Unix line-ending issue?



More information about the Libraries mailing list