Skip to content

Feature request: Add --with-repl option #9115

@sol

Description

@sol

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:

  1. The need for doctest to proxy invocations to ghc complicates doctest. While doctest 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 and ghci to do its thing .
  2. Some packages (notably ghc-paths) will be broken when they are built with doctest proxying to ghc. For that reason, a user needs to take great care to ensure that any such packages have already been built before they invoke doctest in such a manner.

--with-repl will address those issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions