[commit: packages/Cabal] ghc-head: Test suite: canonicalize binary path before execution (haskell/cabal#1458) (86800bb)

git at git.haskell.org git at git.haskell.org
Wed Sep 4 23:58:26 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=86800bbfd0cafa52fd4a67134b001286db023a3e

>---------------------------------------------------------------

commit 86800bbfd0cafa52fd4a67134b001286db023a3e
Author: Paolo G. Giarrusso <p.giarrusso at gmail.com>
Date:   Sat Aug 31 22:39:29 2013 +0200

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


>---------------------------------------------------------------

86800bbfd0cafa52fd4a67134b001286db023a3e
 Cabal/tests/PackageTests/PackageTester.hs |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Cabal/tests/PackageTests/PackageTester.hs b/Cabal/tests/PackageTests/PackageTester.hs
index 15e1cc3..dbac81c 100644
--- a/Cabal/tests/PackageTests/PackageTester.hs
+++ b/Cabal/tests/PackageTests/PackageTester.hs
@@ -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)





More information about the ghc-commits mailing list