Skip to content

Commit

Permalink
Allow to specify the used ghc executable by setting SENSEI_GHC
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Oct 18, 2024
1 parent 559eaf6 commit 3b6235d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Language/Haskell/GhciWrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@ new startupFile Config{..} envDefaults args_ = do

let
mandatoryArgs :: [String]
mandatoryArgs = ["-fshow-loaded-modules"]
mandatoryArgs = ["-fshow-loaded-modules", "--interactive"]

args :: [String]
args = "-ghci-script" : startupFile : args_ ++ catMaybes [
if configIgnoreDotGhci then Just "-ignore-dot-ghci" else Nothing
] ++ mandatoryArgs

ghc :: String
ghc = fromMaybe "ghc" $ lookup "SENSEI_GHC" env

(stdoutReadEnd, stdoutWriteEnd) <- createPipe

(Just stdin_, Nothing, Nothing, processHandle ) <- createProcess (proc "ghci" args) {
(Just stdin_, Nothing, Nothing, processHandle ) <- createProcess (proc ghc args) {
cwd = configWorkingDirectory
, env = Just $ envDefaults ++ env
, std_in = CreatePipe
Expand Down
2 changes: 1 addition & 1 deletion test/ClientSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec = do

it "indicates failure" $ do
withFailure $ \ dir -> do
client dir [] `shouldReturn` (False, "failure")
client dir ["--color"] `shouldReturn` (False, fromString $ withColor Red "failure")

context "when server socket is missing" $ do
it "reports error" $ do
Expand Down

0 comments on commit 3b6235d

Please sign in to comment.