[GHC] #723: The package database should be a directory of files instead of a single file

GHC trac at galois.com
Tue Mar 14 11:08:42 EST 2006


#723: The package database should be a directory of files instead of a single
file
-------------------------------+--------------------------------------------
  Reporter:  simonmar          |          Owner:         
      Type:  task              |         Status:  new    
  Priority:  normal            |      Milestone:         
 Component:  Compiler          |        Version:  6.4.1  
  Severity:  normal            |     Resolution:         
  Keywords:                    |             Os:  Unknown
Difficulty:  Moderate (1 day)  |   Architecture:  Unknown
-------------------------------+--------------------------------------------
Comment (by simonmar):

 Comments from Duncan Coutts:

 One downside to using a dir approach is that it makes it harder to
 optimise the format of these files (since they do take a little while to
 parse).

 One could use a binary format for the installed files, but it still
 means opening several small files. That's probably the sweet-spot for
 performance/effort. It might be possible to keep the package.conf files
 in the nice cabal text formal and then build a cache. However it's not
 obvious where such a cache would go. It could go in the users ~/.ghc
 directory but that will not work well for the root user. For example on
 gentoo and debian updating such a cache would cause a sandbox violation
 during a build.

 So for example we could use ghc-pkg to install into a given package db
 dir and it could write the binary format file:

 ghc-pkg register foo.pkg -f buildtmp/package.conf.d/ --force

 On a related note, we sadly have to use --force in this instance since
 we're installing into a temp dir so the directories do not exist yet in
 the real root file system. We could avoid {{{--force}}} with {{{--pkg-
 root=
 ${DESTDIR}}}} or something, but it'd need more complexity in ghc-pkg.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/723>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list