summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Rules/BinaryDist.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs
index 9a0a1e71e4..b8b980d245 100644
--- a/hadrian/src/Rules/BinaryDist.hs
+++ b/hadrian/src/Rules/BinaryDist.hs
@@ -163,7 +163,11 @@ bindistRules = do
-- a wrapper script on platforms (windows) which don't support symlinks.
if windowsHost
then createVersionWrapper version_prog unversioned_install_path
- else createFileLink install_path unversioned_install_path
+ else liftIO $ do
+ -- Use the IO versions rather than createFileLink because
+ -- we need to create a relative symlink.
+ IO.removeFile unversioned_install_path <|> return ()
+ IO.createFileLink version_prog unversioned_install_path
copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir
copyDirectory (rtsIncludeDir) bindistFilesDir