[Hackage] #731: Custom Build-type with --package-db and --global encounters runtime error

#731: Custom Build-type with --package-db and --global encounters runtime error ---------------------------------+------------------------------------------ Reporter: cygnus | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.8.0.4 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.2 Platform: Linux | ---------------------------------+------------------------------------------ To reproduce: * Run `cabal init`, change `Build-type` to `Custom` (`Setup.hs` already provided by `cabal init`) * Run `ghc-pkg init db` * Run `cabal configure --package-db=./db --global` * Output: {{{ Resolving dependencies... cabal: internal error: unexpected package db stack }}} In `cabal-install-0.8.2`, this appears to be caused by the code on lines 112-114 of `Distribution.Client.Configure`: {{{ usePackageDB = if UserPackageDB `elem` packageDBs then packageDBs else packageDBs ++ [UserPackageDB] }}} in combination with the code on lines 297-306 of `Distribution.Client.SetupWrapper`: {{{ ghcPackageDbOptions :: PackageDBStack -> [String] ghcPackageDbOptions dbstack = case dbstack of (GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs (GlobalPackageDB:dbs) -> "-no-user-package-conf" : concatMap specific dbs _ -> ierror where specific (SpecificPackageDB db) = [ "-package-conf", db ] specific _ = ierror ierror = error "internal error: unexpected package db stack" }}} Essentially, the order of the package databases in the stack is not as expected since the list already contains a `SpecificPackageDB` when the `UserPackageDB` is appended. (Note: this applies to GHC 6.12.3 and Cabal 1.8.0.6 on my system, but I could not select those versions in the ticket properties.) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/731 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#731: Custom Build-type with --package-db and --global encounters runtime error ---------------------------------+------------------------------------------ Reporter: cygnus | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.8.0.4 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.2 Platform: Linux | ---------------------------------+------------------------------------------ Changes (by erkokl@…): * cc: Erkok (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/731#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#731: Custom Build-type with --package-db and --global encounters runtime error ---------------------------------+------------------------------------------ Reporter: cygnus | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.8.0.4 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.2 Platform: Linux | ---------------------------------+------------------------------------------ Changes (by hvr): * cc: hvr@… (added) Comment: Alas, this still applies to latest (unreleased) `Cabal-1.13.3` / `cabal- install-0.13.3` / GHC-7.3 versions Also, `cabal-dev` calls `cabal` with that `--package-db`/`--global` combination, causing this "unexpected package db stack" error... -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/731#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#731: Custom Build-type with --package-db and --global encounters runtime error ---------------------------------+------------------------------------------ Reporter: cygnus | Owner: Type: defect | Status: new Priority: normal | Milestone: cabal-install-0.14 Component: cabal-install tool | Version: 1.8.0.4 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.2 Platform: Linux | ---------------------------------+------------------------------------------ Changes (by kosmikus): * milestone: => cabal-install-0.14 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/731#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#731: Custom Build-type with --package-db and --global encounters runtime error
---------------------------------+------------------------------------------
Reporter: cygnus | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: cabal-install-0.14
Component: cabal-install tool | Version: 1.8.0.4
Severity: normal | Resolution: fixed
Keywords: | Difficulty: unknown
Ghcversion: 6.12.2 | Platform: Linux
---------------------------------+------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
Thanks for the report, and pinpointing the location of the problem.
{{{
Wed Mar 28 23:05:56 BST 2012 Duncan Coutts
participants (1)
-
Hackage