Opened 9 years ago

Closed 9 years ago

#4060 closed bug (fixed)

runhaskell Setup register fails with "internal error: unexpected package db stack"

Reported by: mrothe Owned by: duncan
Priority: high Milestone: 6.12.3
Component: Compiler Version: 6.12.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I built 6.12.2 using the already installed (and working) ghc-6.12.1. I built ghc-6.12.2 using the same procedure as 6.12.1, so it's unlikely to be caused by build procedure changes. If I try to compile packages using the new version everything works fine until I try to generate the script:

$ tar xf zlib-
$ runhaskell Setup configure --prefix=/usr --libdir=/usr/lib64 \
    --docdir=/usr/share/doc/zlib- \
    --htmldir=/usr/share/doc/zlib- \
    --with-compiler=ghc-6.12.2 --enable-shared \
    --disable-executable-stripping --global --verbose \
$ runhaskell Setup build
$ runhaskell Setup copy --destdir=$PWD/install-root/
$ runhaskell Setup register --global --gen-script
Creating package registration script:
Setup: internal error: unexpected package db stack

This happens with every package I tried to far. Could someone help me narrow this problem down?

Change History (4)

comment:1 Changed 9 years ago by igloo

Milestone: 6.12.3
Owner: set to duncan
Priority: normalhigh

Also happens with HEAD.

$ ghc --make Setup
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )
Linking Setup ...
$ ./Setup configure
Configuring zlib-
$ ./Setup register --global --gen-script
Creating package registration script:
Setup: internal error: unexpected package db stack

The package DB stack looks like this: [GlobalPackageDB,GlobalPackageDB]

Duncan, are you able to take a look at this, please?

comment:2 Changed 9 years ago by duncan

Resolution: fixed
Status: newclosed

The workaround (and indeed the sensible thing to do) is not to try and override the target package db at register time and just use the one selected at configure time.

Sat May 15 22:32:04 BST 2010  Duncan Coutts <>
  * Fix register --global/--user
  It is a rather silly feature and is not guaranteed to work. Having
  configured and built using one set of dbs, there's no guarantee you
  can register into another set. We should probably just remove it.

I'd also like to know if anyone would miss this "feature" if I removed it. Configuring and building using one set of packages and then registering into another set is highly dubious. We don't need to make it too easy, or people will do it accidentally without thinking. It's still possible of course simply by making a registraiton file and registering manually.

That or we should ban certain combinations, like configuring with --user and registering with --global.

comment:3 Changed 9 years ago by igloo

Status: closedmerge

But if we're making a registration script then we're probably planning to install it on a different machine anyway.

comment:4 Changed 9 years ago by igloo

Status: mergeclosed


Note: See TracTickets for help on using tickets.