-
Notifications
You must be signed in to change notification settings - Fork 712
Add --with-repl flag to modify program the "repl" starts with #10996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This refactoring modifies the logic to start the multi-repl to use runGHCWithResponseFile rather than directly constructing a command line. Towards #10881
> hie-bios debug src/HIE/Bios.hs
Root directory: /home/hugin/Documents/haskell/hie-bios
Component directory: /home/hugin/Documents/haskell/hie-bios
GHC options: @/tmp/ghci84462-0.rsp
GHC library directory: CradleSuccess "/home/hugin/.ghcup/ghc/9.6.7/lib/ghc-9.6.7/lib"
GHC version: CradleSuccess "9.6.7"
Config Location: No explicit config found
Cradle: Cradle{ cradleRootDir = "/home/hugin/Documents/haskell/hie-bios", cradleOptsProg = CradleAction: Cabal}
Dependencies: hie-bios.cabal cabal.project cabal.project.local The branch passes the test-suite with the |
e347e40
to
c037a88
Compare
Programs like doctest and hie-bios want to use `cabal-install` in order to discover the correct options to start a GHC session. Previously they used the `--with-compiler` option, but this led to complications since the wrapper was called for compiling all dependencies and so on, the shim had to be more complicated and forward arguments onto the user's version of GHC. The `--with-repl` command allows you to pass a program which is used instead of GHC at the final invocation of the repl. Therefore the wrappers don't have to deal with being a complete shim but can concentrate on intercepting the arguments at the end. This commit removes the special hack to not use response files with --interactive mode. Tools are expected to deal with them appropiately, which is much easier now only one invocation is passed to the wrapper. Fixes #9115
@@ -751,10 +751,10 @@ runReplOrWriteFlags ghcProg lbi rflags ghcOpts pkg_name target = | |||
verbosity = fromFlag $ setupVerbosity common | |||
tempFileOptions = commonSetupTempFileOptions common | |||
in case replOptionsFlagOutput (replReplOptions rflags) of | |||
NoFlag -> | |||
runGHCWithResponseFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOC what breaks (or has the potential to break) if we don't use a response file?
Configuring library for cabal-with-repl-0.1.0.0... | ||
Preprocessing library for cabal-with-repl-0.1.0.0... | ||
Error: [Cabal-7125] | ||
repl failed for cabal-with-repl-0.1.0.0-inplace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should provide more information about the failure somewhere.
``` | ||
|
||
This change also removes the special handling for response files with `--interactive` | ||
mode, as tools are now expected to handle response files appropriately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that wise?
Programs like doctest and hie-bios want to use
cabal-install
in orderto discover the correct options to start a GHC session. Previously they
used the
--with-compiler
option, but this led to complications sincethe wrapper was called for compiling all dependencies and so on, the
shim had to be more complicated and forward arguments onto the user's
version of GHC.
The
--with-repl
command allows you to pass a program which is usedinstead of GHC at the final invocation of the repl. Therefore the
wrappers don't have to deal with being a complete shim but can
concentrate on intercepting the arguments at the end.
This commit removes the special hack to not use response files with
--interactive mode. Tools are expected to deal with them appropiately,
which is much easier now only one invocation is passed to the wrapper.
Fixes #9115
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significant
in the changelog file.