summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-08-09 10:15:30 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-08-09 10:20:50 +0100
commit36b8458200178ada8d97e28bf2b2ad83fff9dbca (patch)
tree7e2442489fcaead56fa32e16d34476707abca1b4
parentb7f999833da170f24aea1f5843cc3791f300eaea (diff)
downloadhaskell-wip/T20208.tar.gz
Create absolute symlink for test executableswip/T20208
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