Opened 11 years ago

Closed 7 years ago

Last modified 7 years ago

#723 closed task (fixed)

The package database should be a directory of files instead of a single file

Reported by: simonmar Owned by:
Priority: normal Milestone: 6.12 branch
Component: Package system Version: 6.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: N/A
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This would help package systems that want to install packages by just unpacking a bunch of files onto the filesystem, amongst other things.


Change History (10)

comment:1 Changed 11 years ago 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.

comment:2 Changed 11 years ago by greenrd@…

Owner: set to guest
Status: newassigned

I'm packaging Haskell stuff for rPath Linux, and I'm going to look into implementing at least the splitting out part of this task.

comment:3 Changed 10 years ago by igloo

Milestone: 6.8
Test Case: N/A

comment:4 Changed 9 years ago by simonmar

Milestone: 6.8 branch6.10 branch
Owner: guest deleted
Status: assignednew

See also #593

comment:5 Changed 8 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:6 Changed 8 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:7 Changed 8 years ago by igloo

Milestone: 6.10 branch6.12 branch

comment:8 Changed 8 years ago by simonmar

Component: CompilerPackage system

comment:9 Changed 7 years ago by simonmar

Resolution: fixed
Status: newclosed

The package DB is now a directory of files by default (the old text-file format is still supported).

Thu Sep 10 03:27:03 PDT 2009  Simon Marlow <>
  * Change the representation of the package database
  Ignore-this: 7c9b38ded7f753d5bb95743695700dbc
   - the package DB is a directory containing one file per package
     instance (#723)
   - there is a binary cache of the database (#593, #2089)
   - the binary package is now a boot package
   - there is a new package, bin-package-db, containing the Binary
     instance of InstalledPackageInfo for the binary cache.
  Also included in this patch
   - Use colour in 'ghc-pkg list' to indicate broken or hidden packages
     Broken packages are red, hidden packages are 
     Colour support comes from the terminfo package, and is only used when
      - not --simple-output
      - stdout is a TTY
      - the terminal type has colour capability
   - Fix the bug that 'ghc-pkg list --user' shows everything as broken

comment:10 Changed 7 years ago by simonmar

difficulty: Moderate (1 day)Moderate (less than a day)
Note: See TracTickets for help on using tickets.