summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-08-09 10:15:30 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-13 21:47:26 -0400
commit9700b9a878640747f9460e2d681b6dd08cd7da54 (patch)
tree256cbaeb884b1bc685eca45cf1982a6dbf477db1
parent0bf8e73ad6d8614a53dd6fad7851135d56b59c10 (diff)
downloadhaskell-9700b9a878640747f9460e2d681b6dd08cd7da54.tar.gz
Create absolute symlink for test executables
This is necessary because the symlink needs to be created between two arbritary filepaths in the build tree, it's hard to compute how to get between them relatively. As this symlink doesn't end up in a bindist then it's fine for it to be absolute.
-rw-r--r--hadrian/src/Rules/Test.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs
index ff986f879e..eeddfd9c3b 100644
--- a/hadrian/src/Rules/Test.hs
+++ b/hadrian/src/Rules/Test.hs
@@ -18,6 +18,7 @@ import Settings.Program (programContext)
import Target
import Utilities
import Context.Type
+import qualified System.Directory as IO
ghcConfigHsPath :: FilePath
ghcConfigHsPath = "testsuite/mk/ghc-config.hs"
@@ -81,7 +82,8 @@ testRules = do
then do
let stg = stageOf testGhc
prog_path <- programPath =<< programContext stg progPkg
- createFileLink prog_path path
+ abs_prog_path <- liftIO (IO.canonicalizePath prog_path)
+ createFileLink abs_prog_path path
-- otherwise, build it by directly invoking ghc
else do
bindir <- getBinaryDirectory testGhc