Skip to content

Commit

Permalink
Prefer compilers including the version number
Browse files Browse the repository at this point in the history
This should hopefully fix #4433, by finding the Haddock executable even
though the copy without a version suffix is unavailable.
  • Loading branch information
snoyberg committed Apr 14, 2019
1 parent abf4ca0 commit 59c4151
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/Stack/Setup.hs
Expand Up @@ -698,11 +698,21 @@ ensureSandboxedCompiler sopts getSetupInfo' = do
ensureGhcjsBooted cv (soptsInstallIfMissing sopts) (soptsGHCJSBootOpts sopts)
_ -> pure ()

let name =
case wc of
Ghc -> "ghc"
Ghcjs -> "ghcjs"
withProcessContext menv $ findExecutable name >>= either throwIO parseAbsFile
let names =
case wanted of
WCGhc version -> ["ghc-" ++ versionString version, "ghc"]
WCGhcGit{} -> ["ghc"]
WCGhcjs{} -> ["ghcjs"]
loop [] = do
logError $ "Looked for sandboxed compiler named one of: " <> displayShow names
logError $ "Could not find it on the paths " <> displayShow (edBins paths)
throwString "Could not find sandboxed compiler"
loop (x:xs) = do
res <- findExecutable x
case res of
Left _ -> loop xs
Right y -> parseAbsFile y
withProcessContext menv $ loop names

when (soptsSanityCheck sopts) $ sanityCheck compiler
cp <- pathsFromCompiler wc compilerBuild isSandboxed compiler
Expand Down

0 comments on commit 59c4151

Please sign in to comment.