#5977: Allow ignoring global package db ------------------------------+--------------------------------------------- Reporter: duncan | Owner: Type: feature request | Status: new Priority: normal | Component: Compiler Version: 7.4.1 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Testcase: Blockedby: | Blocking: Related: | ------------------------------+--------------------------------------------- For sandboxing, users want to be able to use only local package dbs. To handle rts, base etc, they copy those specific packages from the global package db into a local package db.
Currently however there is no sensible way to tell ghc to look '''only''' at the listed package dbs, and not the global db. There is a flag `-no- user-package-conf` to avoid looking at the per-user one, but no equivalent to ignore or to specify the global one. (Note: as a quirky non-sensible way, you can use `GHC_PACKAGE_PATH=""` to clear the package db stack, but this should be possible using command line flags.) The user interface we're now using in cabal is like this: * `--global` sets the initial db stack to `[GlobalPackageDB]` * `--user` sets the initial db stack to `[GlobalPackageDB, UserPackageDB]` * `--package-db=clear` clears the db stack to `[]` * `--package-db=global` pushes `GlobalPackageDB` on the top of the stack * `--package-db=user` pushes `UserPackageDB` on the top of the stack * `--package-db=`''${otherfile}'' pushes `SpecificPackageDB` ''${otherfile}'' on the top of the stack It seems to me we could do something similar with ghc. Currently in ghc we have a `-hide-all-packages` flag that resets the package set to empty. We could do with an equivalent for the package database stack. I suggest something like: * `-clear-package-conf` * `-global-package-conf` * `-user-package-conf` (and the existing `-no-user-package-conf`) * `-package-conf` file The default would remain that the global and user dbs are used, but this can be reset using `-clear-package-conf`. Personally I prefer the nomenclarture "package db" rather than "package conf" here, but it's not that important. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5977> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs