-
Notifications
You must be signed in to change notification settings - Fork 714
Closed
Milestone
Description
Proposal
We already have:
--ghc-options
specifies options that are used for compilation.--with-ghc
specifies the executable that is used for compilation.--repl-options
specifies options that are used when opening a REPL.
In addition to those, I would love to see:
--with-repl
specifies the executable that is used when opening a REPL.
Motivation
This can be useful for running arbitrary tools that require the same command line options as ghci
.
Personally, I want to use this with doctest
?
As of now, the way I recommend to run doctest
with cabal
is:
$ cabal repl --with-ghc=doctest
For this to this work, doctest
has to proxy all invocations to ghc
, unless it sees --interactive
, at which point it takes over.
This mostly works, but has the following issues:
- The need for
doctest
to proxy invocations toghc
complicatesdoctest
. Whiledoctest
could technically be agnostic to command line options, it currently has to look at them to decide whether to proxy the invocation, or whether to start an API session andghci
to do its thing . - Some packages (notably
ghc-paths
) will be broken when they are built withdoctest
proxying toghc
. For that reason, a user needs to take great care to ensure that any such packages have already been built before they invokedoctest
in such a manner.
--with-repl
will address those issues.
fendor