RE: Bug in Cabal creating user package.conf

On 30 April 2005 09:06, Ashley Yakeley wrote:
In article <87ekcsr9u0.fsf@syntaxpolice.org>, Isaac Jones
wrote: 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 newline:
This is on Mac OS X, and it's definitely Setup.hs that's creating the file, and it definitely has just "[]".
Transcript (prompt reduced to "$ " for brevity):
$ cat Setup.hs import Distribution.Simple main = defaultMain $ rm -rf ~/.ghc $ runghc Setup.hs configure Warning: Package is copyright All Rights Reserved Warning: No license-file field. Configuring TimeLib-0.1... configure: searching for ghc in path. configure: found ghc at /usr/local/bin/ghc configure: looking for package tool: ghc-pkg near compiler in /usr/local/bin/ghc configure: found package tool in /usr/local/bin/ghc-pkg configure: Using install prefix: /usr/local configure: Using compiler: /usr/local/bin/ghc configure: Compiler flavor: GHC configure: Compiler version: 6.4 configure: Using package tool: /usr/local/bin/ghc-pkg configure: Using haddock: /usr/local/bin/haddock configure: Using happy: /usr/local/bin/happy configure: Using alex: /usr/local/bin/alex configure: Using hsc2hs: /usr/local/bin/hsc2hs configure: No cpphs found configure: Reading installed packages... cannot parse package list $ cat ~/.ghc/powerpc-darwin-6.4/package.conf []$ uname -a Darwin Avebury.local 7.8.0 Darwin Kernel Version 7.8.0: Wed Dec 22 14:26:17 PST 2004; root:xnu/xnu-517.11.1.obj~1/RELEASE_PPC Power Macintosh powerpc $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.4 $ ls -Al ~/.ghc/powerpc-darwin-6.4/package.conf -rw-r--r-- 1 ashley ashley 2 Apr 30 00:57 /Users/ashley/.ghc/powerpc-darwin-6.4/package.conf
It's not a newline issue, something else strange is going on here. Your local package.conf is being created by ghc-pkg (which is a little eager to create it in 6.4; 6.4.1 will be better). The parse error is coming from Cabal (Distribution.Simple.Configure) which is having trouble parsing the list of packages from ghc-pkg list. Could you post your output from "ghc-pkg list" after running the configure step above? Cheers, Simon

In article
<3429668D0E777A499EE74A7952C382D1038EBEE9@EUR-MSG-01.europe.corp.microso
ft.com>,
"Simon Marlow"
It's not a newline issue, something else strange is going on here.
You're right, if I run "runghc Setup.hs configure" a second time, it works. Also, I have the same issue on Linux.
Your local package.conf is being created by ghc-pkg (which is a little eager to create it in 6.4; 6.4.1 will be better).
The parse error is coming from Cabal (Distribution.Simple.Configure) which is having trouble parsing the list of packages from ghc-pkg list. Could you post your output from "ghc-pkg list" after running the configure step above?
This is on Linux: $ rm -rf ~/.ghc $ runghc Setup.hs configure Warning: Package is copyright All Rights Reserved Warning: No license-file field. Configuring TimeLib-0.1... configure: searching for ghc in path. configure: found ghc at /usr/bin/ghc configure: looking for package tool: ghc-pkg near compiler in /usr/bin/ghc configure: found package tool in /usr/bin/ghc-pkg configure: Using install prefix: /usr/local configure: Using compiler: /usr/bin/ghc configure: Compiler flavor: GHC configure: Compiler version: 6.4 configure: Using package tool: /usr/bin/ghc-pkg configure: Using haddock: /usr/bin/haddock configure: Using happy: /usr/bin/happy configure: No alex found configure: Using hsc2hs: /usr/bin/hsc2hs configure: No cpphs found configure: Reading installed packages... cannot parse package list $ ghc-pkg list /usr/lib/ghc-6.4/package.conf: rts-1.0, base-1.0, haskell98-1.0, template-haskell-1.0, unix-1.0, Cabal-1.0, parsec-1.0, haskell-src-1.0, network-1.0, QuickCheck-1.0, HUnit-1.1, mtl-1.0, fgl-5.2, X11-1.1, HGL-3.1, OpenGL-2.0, GLUT-2.0, stm-1.0, readline-1.0, (lang-1.0), (concurrent-1.0), (posix-1.0), (util-1.0), (data-1.0), (text-1.0), (net-1.0), (hssource-1.0) /home/ashley/.ghc/i386-linux-6.4/package.conf: -- Ashley Yakeley, Seattle WA
participants (2)
-
Ashley Yakeley
-
Simon Marlow