ghc-pkg bug? possible cabal workaround?

Isaac Jones ijones at syntaxpolice.org
Thu Aug 10 12:41:52 EDT 2006


Heya Simon.

I've noticed that in ghc 6.4.2, ghc-pkg doesn't create the file (or
maybe just the directory) when trying to register a package:

rm  -r ~/.ghc/i386-linux-6.4.2
/usr/bin/ghc-pkg update .installed-pkg-config --user
ghc-pkg.bin: /home/ijones/.ghc/i386-linux-6.4.2/package.conf: getPermissions: does not exist (No such file or directory)

Cabal could try to create the file & directory w/ something like what
you have in ghc-pkg plus createDirectoryIfMissing, but I'm a bit
nervous of using the System.Info stuff since I know it's pretty new.
I'd like to keep cabal working w/ ghc 6.2.  We can probably solve this
by creating a ghc 6.3 version of
Distribution.GHCPackageConfig.maybeCreateLocalPackageConfig and
calling it around line 149 of Distribution.Simple.Register.

Here's how ghc-pkg generates the filename:

  appdir <- getAppUserDataDirectory "ghc"

  let
	subdir = targetARCH ++ '-':targetOS ++ '-':version
	archdir   = appdir `joinFileName` subdir
	user_conf = archdir `joinFileName` "package.conf"
  user_exists <- doesFileExist user_conf

I'm not sure where the bug is in ghc-pkg; it's not obvious to me, but
it'll probably be obvious to you.  Should we implement a cabal
workaround?  Has anyone complained about this?

peace,

  isaac


More information about the cabal-devel mailing list