#1463: Module → Package lookup in ghc-pkg?
----------------------------------+-----------------------------------------
    Reporter:  [EMAIL PROTECTED]  |        Owner:         
        Type:  feature request    |       Status:  new    
    Priority:  normal             |    Milestone:  6.10   
   Component:  Compiler           |      Version:  6.6.1  
    Severity:  normal             |   Resolution:         
    Keywords:                     |   Difficulty:  Unknown
          Os:  Unknown            |     Testcase:         
Architecture:  Unknown            |  
----------------------------------+-----------------------------------------
Changes (by simonmar):

  * milestone:  => 6.10

Comment:

 in fact, i thought it should be one of the things cabal ought to be good
 at, but
   looking through the haddocks for Distribution.*, i seem to be running
 around in
   circles: is there any standard way to get at the installed package.conf
 files, or
   directly at the InstalledPackageInfos?? there's a getInstalledPackages,
 but that only
   gives me the PackageIdentifiers?, with no obvious way to go further?

 This is parly by design.  Cabal interacts with the package database only
 using the `ghc-pkg` tool (`hc-pkg` in general), the idea being that the
 representation and location of the package database can be compiler-
 dependent.  There's no requirement that the package database is stored in
 the way that GHC does it, or even that the package database contains
 `InstalledPackageInfo`s - a compiler might want to add extra information
 about each package.  In fact, GHC already has an alternative way to store
 the package database (files in `package.conf.d`).

 To get an `InstalledPackageInfo` for a given package, you have to use
 `ghc-pkg describe` and parse the output (I believe it should work).
 Parsing `package.conf` directly is non-portable, and risks breakage in the
 future.  We could add a way to get the `Read/Show` version of an
 `InstalledPackageInfo`, if that would make it easier.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1463>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to