Commit 86800bbf authored by Blaisorblade's avatar Blaisorblade
Browse files

Test suite: canonicalize binary path before execution (haskell/cabal#1458)

parent 6f99105f
......@@ -176,8 +176,10 @@ cabal spec cabalArgs ghcPath = do
run :: Maybe FilePath -> String -> [String] -> IO (String, ExitCode, String)
run cwd path args = do
verbosity <- getVerbosity
-- path is relative to the current directory; canonicalizePath makes it
-- absolute, so that runProcess will find it even when changing directory.
path' <- do pathExists <- doesFileExist path
return (if pathExists then path else path <.> exeExtension)
canonicalizePath (if pathExists then path else path <.> exeExtension)
printRawCommandAndArgs verbosity path' args
(readh, writeh) <- createPipe
pid <- runProcess path' args cwd Nothing Nothing (Just writeh) (Just writeh)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment