Ticket #335 (closed defect: fixed)

Opened 5 years ago

Last modified 14 months ago

GHC_PACKAGE_PATH disrespected

Reported by: cjs Owned by: kmcallister
Priority: normal Milestone: Cabal-1.8
Component: Cabal library Version: 1.2.3.0
Severity: normal Keywords:
Cc: Difficulty: very easy (<1 hour)
GHC Version: 6.8.3 Platform: Other Unix

Description

Looks like cabal doesn't even use GHC_PACKAGE_PATH at all.

$ unset GHC_PACKAGE_PATH
$ ghc-pkg list binary
/usr/pkg/lib/ghc-6.8.3/package.conf:
$ export GHC_PACKAGE_PATH=/my/package.conf:/usr/pkg/lib/ghc-6.8.3/package.conf
$ ghc-pkg list binary
/usr/pkg/lib/ghc-6.8.3/package.conf:
/my/package.conf:
    binary-0.4.1
$ runghc Setup.hs configure
Configuring mypackage-1.0...
Setup.hs: At least the following dependencies are missing:
    binary -any

Attachments

warn-that-we-ignore-ghc_package_path.dpatch Download (66.8 KB) - added by kmcallister 3 years ago.

Change History

Changed 5 years ago by duncan

Cabal supports the --package-db=db flag.

Currently it does not support specifying multiple dbs using --package-db, or using the normal per-user db and a specific one, but it probably should.

Changed 5 years ago by cjs

After some discussion, I'm in agreement with dcoutts that this environment variable should be ignored, possibly with a warning. This is because it's more or less "hidden"; it's not visible on a command line, and thus will often be forgotten when reporting bugs, it's ghc-specific anyway, and so on. I think it should be a wontfix.

Changed 5 years ago by duncan

Simon suggested that perhaps the most user friendly solution for the few users of this env var is to fail at configure if GHC_PACKAGE_PATH is set and to tell users about the --package-db= flag.

Changed 4 years ago by duncan

  • priority changed from high to normal

Changed 4 years ago by duncan

  • difficulty changed from normal to very easy (<1 hour)
  • milestone set to Cabal-1.8

Changed 3 years ago by kmcallister

  • owner set to kmcallister
  • status changed from new to assigned

Changed 3 years ago by kmcallister

Changed 3 years ago by kmcallister

Patch is attached.

Changed 14 months ago by duncan

  • status changed from assigned to closed
  • resolution set to fixed

Applied thanks, or something very similar. I changed it so we actually die, since I think it's not good if ghc and cabal are looking at different package dbs.

Wed Mar 28 22:45:22 BST 2012  Duncan Coutts <duncan@community.haskell.org>
  * Check for the env var GHC_PACKAGE_PATH
  Based on the patch by Keegan McAllister <mcallister.keegan@gmail.com>
  Fixes ticket #335
Note: See TracTickets for help on using tickets.