ghc-pkg regression (or deliberate change)?

Simon Marlow marlowsd at gmail.com
Tue Mar 1 12:05:54 CET 2011


On 22/02/2011 22:38, Tyler Pirtle wrote:
> Hi there,
>
> I'm using a system with an older version of GHC (6.8.3), and invoking
> ghc-pkg against a non-existing file in -f:
>
> $ haskell/ghc/v683/k8/lib/ghc-6.8.3/ghc-pkg.bin --global-conf
> haskell/ghc/v683/k8/lib/ghc-6.8.3/package.conf -f
> /tmp/nonexistent.Foo.package.conf register /tmp/Foo.package_spec
>
> ghc-pkg happily creates the file referenced with -f and fills it with
> these contents:
>
>
> [InstalledPackageInfo {package = PackageIdentifier {pkgName =
> "hsS-SFoo", pkgVersion = Version {versionBranch = [1,0], versionTags =
> []}}, license = AllRightsReserved, copyright = "", maintainer = "",
> author = "", stability = "", homepage = "", pkgUrl = "", description =
> "", category = "", exposed = False, exposedModules = [], hiddenModules
> = [], importDirs = [], libraryDirs = [], hsLibraries = [],
> extraLibraries = [], extraGHCiLibraries = [], includeDirs = [],
> includes = [], depends = [], hugsOptions = [], ccOptions = [],
> ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces
> = [], haddockHTMLs = []}
> ]
>
>
> GHC 7.0.1 it appears does not do the same thing:
>
> $ haskell/ghc/v701/k8/lib/ghc-7.0.1/ghc-pkg --global-conf
> haskell/ghc/v701/k8/lib/ghc-7.0.1/package.conf.d -f
> /tmp/nonexistent.Foo.package_conf --force register
> /tmp/Foo.package_spec
> ghc-pkg: .../bin/hs/Foo.package_conf: openFile: does not exist (No
> such file or directory)
>
> (paths have been mangled by hand).
>
> ghc-pkg in 6.8.3 does what it does even without using --force. What am
> i missing in 7.0.1? Is this a bug or is this intentional?

You want to use "ghc-pkg init" to create the package database.  The 
package database format changed, and although ghc-pkg still supports the 
old flat text file format, it prefers to use the new format, which is a 
directory containing one text file for each package with a binary cache.

Cheers,
	Simon



More information about the Glasgow-haskell-users mailing list