Skip to content

Commit 45a2f5d

Browse files
committed
Don't pass filepaths into ghci ":module" #1401
1 parent 6ab16a8 commit 45a2f5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Stack/Ghci.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ ghci GhciOpts{..} = do
106106
("The following GHC options are incompatible with GHCi and have not been passed to it: " <>
107107
T.unwords (map T.pack (nubOrd omittedOpts)))
108108
let modulesToLoad = nubOrd $
109-
maybe [] (return . toFilePath) mainFile <>
110109
concatMap (map display . S.toList . ghciPkgModules) pkgs
110+
thingsToLoad =
111+
maybe [] (return . toFilePath) mainFile <> modulesToLoad
111112
odir =
112113
[ "-odir=" <> toFilePathNoTrailingSep (objectInterfaceDir bconfig)
113114
, "-hidir=" <> toFilePathNoTrailingSep (objectInterfaceDir bconfig)]
@@ -132,8 +133,8 @@ ghci GhciOpts{..} = do
132133
(\tmpDir ->
133134
do let scriptPath = tmpDir </> $(mkRelFile "ghci-script")
134135
fp = toFilePath scriptPath
135-
loadModules = ":load " <> unwords (map show modulesToLoad)
136-
bringIntoScope = ":module + " <> unwords (map show modulesToLoad)
136+
loadModules = ":load " <> unwords (map show thingsToLoad)
137+
bringIntoScope = ":module + " <> unwords modulesToLoad
137138
liftIO (writeFile fp (unlines [loadModules,bringIntoScope]))
138139
finally (execGhci ["-ghci-script=" <> fp])
139140
(removeFile scriptPath))

0 commit comments

Comments
 (0)