Commit 08f12cde authored by kristenk's avatar kristenk Committed by Mikhail Glushenkov
Browse files

Work around issue #5218 in cabal-testsuite.

This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in #5218.
parent 09418b1d
......@@ -516,7 +516,7 @@ withRepo repo_dir m = do
let package_cache = testCabalDir env </> "packages"
liftIO $ appendFile (testUserCabalConfigFile env)
$ unlines [ "repository test-local-repo"
, " url: file:" ++ testRepoDir env
, " url: " ++ repoUri env
, " secure: True"
-- TODO: Hypothetically, we could stick in the
-- correct key here
......@@ -531,6 +531,18 @@ withRepo repo_dir m = do
-- 8. Profit
withReaderT (\env' -> env' { testHaveRepo = True }) m
-- TODO: Arguably should undo everything when we're done...
where
-- Work around issue #5218 (incorrect conversions between Windows paths and
-- file URIs) by using a relative path on Windows.
repoUri env =
if buildOS == Windows
then let relPath = definitelyMakeRelative (testCurrentDir env)
(testRepoDir env)
convertSeparators = intercalate "/"
. map dropTrailingPathSeparator
. splitPath
in "file:" ++ convertSeparators relPath
else "file:" ++ testRepoDir env
------------------------------------------------------------------------
-- * Subprocess run results
......
Markdown is supported
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