summaryrefslogtreecommitdiff
path: root/hadrian/src/Hadrian
diff options
context:
space:
mode:
authorDavid Eichmann <EichmannD@gmail.com>2019-06-04 19:01:19 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-13 02:50:00 -0400
commite98d32a62977fe1057ebbb1b6ed8990438cb9896 (patch)
tree81204fa5fd3a5f1ebd1c834dc0445a22dbc88a92 /hadrian/src/Hadrian
parenta657543c4d676b7e6e0984b72b31dd95949855e4 (diff)
downloadhaskell-e98d32a62977fe1057ebbb1b6ed8990438cb9896.tar.gz
Hadrian: Track RTS library symlink targets
This requires creating RTS library symlinks when registering, outside of the rule for the registered library file.
Diffstat (limited to 'hadrian/src/Hadrian')
-rw-r--r--hadrian/src/Hadrian/Utilities.hs20
1 files changed, 7 insertions, 13 deletions
diff --git a/hadrian/src/Hadrian/Utilities.hs b/hadrian/src/Hadrian/Utilities.hs
index a1386e68fc..48ba34964e 100644
--- a/hadrian/src/Hadrian/Utilities.hs
+++ b/hadrian/src/Hadrian/Utilities.hs
@@ -16,7 +16,7 @@ module Hadrian.Utilities (
BuildRoot (..), buildRoot, buildRootRules, isGeneratedSource,
-- * File system operations
- copyFile, copyFileUntracked, createFileLink, createFileLinkUntracked, fixFile,
+ copyFile, copyFileUntracked, createFileLink, fixFile,
makeExecutable, moveFile, removeFile, createDirectory, copyDirectory,
moveDirectory, removeDirectory,
@@ -290,17 +290,6 @@ infixl 1 <&>
isGeneratedSource :: FilePath -> Action Bool
isGeneratedSource file = buildRoot <&> (`isPrefixOf` file)
--- | Link a file (without tracking the link target). Create the target directory
--- if missing.
-createFileLinkUntracked :: FilePath -> FilePath -> Action ()
-createFileLinkUntracked linkTarget link = do
- let dir = takeDirectory link
- liftIO $ IO.createDirectoryIfMissing True dir
- putProgressInfo =<< renderCreateFileLink linkTarget link
- quietly . liftIO $ do
- IO.removeFile link <|> return ()
- IO.createFileLink linkTarget link
-
-- | Link a file tracking the link target. Create the target directory if
-- missing.
createFileLink :: FilePath -> FilePath -> Action ()
@@ -309,7 +298,12 @@ createFileLink linkTarget link = do
then linkTarget
else takeDirectory link -/- linkTarget
need [source]
- createFileLinkUntracked linkTarget link
+ let dir = takeDirectory link
+ liftIO $ IO.createDirectoryIfMissing True dir
+ putProgressInfo =<< renderCreateFileLink linkTarget link
+ quietly . liftIO $ do
+ IO.removeFile link <|> return ()
+ IO.createFileLink linkTarget link
-- | Copy a file tracking the source. Create the target directory if missing.
copyFile :: FilePath -> FilePath -> Action ()