Handle :cd in external interpreter in a more robust way

Authored by watashi on Dec 13 2018, 10:43 PM.



We used to enqueue another command to change directory in the external
interpreter subprocess, this is not as robust as:

  • it can fail with -fno-implict-import-qualified;
  • it doesn't work when we setGHCiMonad to something other than IO.

Neither of them works if directory package is hidden though.

Test Plan
$ inplace/bin/ghc-stage2 --interactive # -fexternal-interpreter
GHCi, version 8.7.20181213: http://www.haskell.org/ghc/  :? for help
Prelude> :cd ..
Prelude> System.Directory.getCurrentDirectory
Prelude> :!pwd
Leaving GHCi.

Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
watashi created this revision.Dec 13 2018, 10:43 PM
watashi updated this revision to Diff 19149.Dec 14 2018, 12:50 AM

rebase && ./validate

simonmar accepted this revision.Dec 14 2018, 2:35 AM

Yes, that's better

This revision is now accepted and ready to land.Dec 14 2018, 2:35 AM
This revision was automatically updated to reflect the committed changes.