cabal-dev icon indicating copy to clipboard operation
cabal-dev copied to clipboard

implement cabal-dev ghci

Open creswick opened this issue 14 years ago • 1 comments

This may be as simple as invoking a command like this: ghci -package-conf cabal-dev/packages-7.0.1.conf/ -no-user-package-conf where cabal-dev is the sandbox directory.

This doesn't incorporate modules from the project under development, if it is not a library, but it does work for libraries.

creswick avatar Dec 22 '10 22:12 creswick

We've made more progress on this issue. As of 4aa1b9102e8314de5596f54e3f95d5d36f020d79, we are using a trick lifted from leksah: Sniff the flags that cabal-install would pass to GHC and use those to invoke ghc --interactive instead. It's still definitely a hack, so I'm leaving this issue open, but it does spin up an interactive environment that faithfully matches the environment that cabal-install uses when building. Open problems:

  • If there is more than one target in the .cabal file, the first one is used, rather than offering the user a choice.
  • In order to use it, you must have already installed dependencies and configured in your sandbox.
  • It does not support specification of multiple package directories, like cabal install does. This makes it somewhat cumbersome to use on a project with more than one actively-developed package.

And finally:

  • It's a bad hack (it depends on the undocumented behavior of cabal-install)

Hopefully the Google Summer of Code project to enable cabal ghci will subsume this soon.

j3h avatar Jul 13 '11 22:07 j3h