@@ -219,7 +219,7 @@ runGhciRepl
219219 :: MonadObelisk m
220220 => FilePath -- ^ Path to .ghci
221221 -> m ()
222−runGhciRepl dotGhci = inProjectShell "ghc" $ unwords $ "ghci" : ["-no-user-package-db", "-ghci-script", dotGhci]
222+runGhciRepl dotGhci = inProjectShell "ghc" $ "ghci " <> makeBaseGhciOptions dotGhci
223223
224224-- | Run ghcid
225225runGhcid
@@ -232,12 +232,20 @@ runGhcid dotGhci mcmd = callCommand $ unwords $ $(staticWhich "ghcid") : opts
232232 opts =
233233 [ "-W"
234234 --TODO: The decision of whether to use -fwarn-redundant-constraints should probably be made by the user
235− , "--command='ghci -Wall -ignore-dot-ghci -fwarn-redundant-constraints -no-user-package-db -ghci-script " <> dotGhci <> "' "
235+ , "--command='ghci -Wall -ignore-dot-ghci -fwarn-redundant-constraints " <> makeBaseGhciOptions dotGhci <> "' "
236236 , "--reload=config"
237237 , "--outputfile=ghcid-output.txt"
238238 ] <> testCmd
239239 testCmd = maybeToList (flip fmap mcmd $ \cmd -> "--test='" <> cmd <> "'")
240240
241+makeBaseGhciOptions :: FilePath -> String
242+makeBaseGhciOptions dotGhci =
243+ unwords
244+ [ "-no-user-package-db"
245+ , "-package-env -"
246+ , "-ghci-script " <> dotGhci
247+ ]
248+
241249getFreePort :: MonadIO m => m PortNumber
242250getFreePort = liftIO $ withSocketsDo $ do
243251 addr:_ <- getAddrInfo (Just defaultHints) (Just "127.0.0.1") (Just "0")
@@ -246,4 +254,4 @@ getFreePort = liftIO $ withSocketsDo $ do
246254 open addr = do
247255 sock <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)
248256 bind sock (addrAddress addr)
249− return sock
257+ return sock