Skip to content

Commit

Permalink
Merge pull request #1210 from mwu-tow/master
Browse files Browse the repository at this point in the history
Ignoring stack-built `ghc` executables when looking for compiler for Setup.hs (#1052).
  • Loading branch information
snoyberg committed Oct 22, 2015
2 parents 888e9ad + d4aeaa9 commit 8ea675e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,18 @@ withSingleContext runInBase ActionContext {..} ExecuteEnv {..} task@Task {..} md

withCabal package pkgDir mlogFile inner = do
config <- asks getConfig
menv <- liftIO $ configEnvOverride config EnvSettings
{ esIncludeLocals = taskLocation task == Local
, esIncludeGhcPackagePath = False
, esStackExe = False
, esLocaleUtf8 = True
}
getGhcPath <- runOnce $ liftIO $ join $ findExecutable menv "ghc"
getGhcjsPath <- runOnce $ liftIO $ join $ findExecutable menv "ghcjs"
let envSettings = EnvSettings
{ esIncludeLocals = taskLocation task == Local
, esIncludeGhcPackagePath = False
, esStackExe = False
, esLocaleUtf8 = True
}
menv <- liftIO $ configEnvOverride config envSettings
-- When looking for ghc to build Setup.hs we want to ignore local binaries, see:
-- https://github.com/commercialhaskell/stack/issues/1052
menvWithoutLocals <- liftIO $ configEnvOverride config envSettings { esIncludeLocals = False }
getGhcPath <- runOnce $ liftIO $ join $ findExecutable menvWithoutLocals "ghc"
getGhcjsPath <- runOnce $ liftIO $ join $ findExecutable menvWithoutLocals "ghcjs"
distRelativeDir' <- distRelativeDir
esetupexehs <-
-- Avoid broken Setup.hs files causing problems for simple build
Expand Down

0 comments on commit 8ea675e

Please sign in to comment.