
On 27/04/2011, at 3:04 AM, Rogan Creswick wrote:
At the moment, cabal-dev ghci just uses the -package-conf and -no-user-package-conf flags to restrict ghci to the sandboxed and global package dbs.
It's difficult to do more without parsing the content of the project's cabal file, and that parser isn't exposed through a library api (it's in cabal-install), which makes it a little difficult to use.
Can't you use cabal as a library to do this? I had a crack at figuring out a ghci command line in TBC (testing by convention): https://github.com/peteg/TBC while waiting for this cabal feature to be implemented: http://hackage.haskell.org/trac/hackage/ticket/382 Apparently there's a GSoC project that will nail this. You can fire up TBC with the verbose flag and it will give you a very long ghc invocation line that is strongly similar to what cabal uses to compile your project. It doubtlessly is incomplete, and probably bit rotten. I will try to make it work with the latest Haskell Platform release in the coming weeks. I welcome patches, but you're better off fixing cabal itself. cheers peter -- http://peteg.org/