@@ -265,6 +265,14 @@ ghciSetup bopts0 noBuild skipIntermediate mainIs additionalPackages = do
265
265
let bopts = bopts0
266
266
{ boptsTargets = boptsTargets bopts0 ++ map T. pack additionalPackages
267
267
}
268
+ -- Try to build, but optimistically launch GHCi anyway if it fails (#1065)
269
+ unless noBuild $ do
270
+ eres <- tryAny $ build (const (return () )) Nothing bopts
271
+ case eres of
272
+ Right () -> return ()
273
+ Left err -> do
274
+ $ logError $ T. pack (show err)
275
+ $ logWarn " Warning: build failed, but optimistically launching GHCi anyway"
268
276
econfig <- asks getEnvConfig
269
277
(realTargets,_,_,_,sourceMap) <- loadSourceMap AllowNoTargets bopts
270
278
menv <- getMinimalEnvOverride
@@ -298,14 +306,6 @@ ghciSetup bopts0 noBuild skipIntermediate mainIs additionalPackages = do
298
306
, " \n (Use --skip-intermediate-deps to omit these)"
299
307
]
300
308
return (directlyWanted ++ intermediateDeps)
301
- -- Try to build, but optimistically launch GHCi anyway if it fails (#1065)
302
- unless noBuild $ do
303
- eres <- tryAny $ build (const (return () )) Nothing bopts
304
- case eres of
305
- Right () -> return ()
306
- Left err -> do
307
- $ logError $ T. pack (show err)
308
- $ logWarn " Warning: build failed, but optimistically launching GHCi anyway"
309
309
-- Load the list of modules _after_ building, to catch changes in unlisted dependencies (#1180)
310
310
let localLibs = [name | (name, (_, target)) <- wanted , hasLocalComp isCLib target]
311
311
infos <-
0 commit comments