diff --git a/src/Stack/Script.hs b/src/Stack/Script.hs index a733381971..75b23c5895 100644 --- a/src/Stack/Script.hs +++ b/src/Stack/Script.hs @@ -35,11 +35,12 @@ import qualified RIO.Text as T scriptCmd :: ScriptOpts -> GlobalOpts -> IO () scriptCmd opts go' = do file <- resolveFile' $ soFile opts - let go = go' + let scriptDir = parent file + go = go' { globalConfigMonoid = (globalConfigMonoid go') { configMonoidInstallGHC = First $ Just True } - , globalStackYaml = SYLNoConfig $ parent file + , globalStackYaml = SYLNoConfig scriptDir } withDefaultBuildConfigAndLock go $ \lk -> do -- Some warnings in case the user somehow tries to set a @@ -92,7 +93,8 @@ scriptCmd opts go' = do withNewLocalBuildTargets targets $ Stack.Build.build Nothing lk let ghcArgs = concat - [ ["-hide-all-packages"] + [ ["-i", "-i" ++ toFilePath scriptDir] + , ["-hide-all-packages"] , maybeToList colorFlag , map (\x -> "-package" ++ x) $ Set.toList