diff options
author | David Eichmann <EichmannD@gmail.com> | 2019-06-04 19:01:19 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-06-13 02:50:00 -0400 |
commit | e98d32a62977fe1057ebbb1b6ed8990438cb9896 (patch) | |
tree | 81204fa5fd3a5f1ebd1c834dc0445a22dbc88a92 /hadrian/src/Rules/Library.hs | |
parent | a657543c4d676b7e6e0984b72b31dd95949855e4 (diff) | |
download | haskell-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/Rules/Library.hs')
-rw-r--r-- | hadrian/src/Rules/Library.hs | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/hadrian/src/Rules/Library.hs b/hadrian/src/Rules/Library.hs index aea855df11..75a2cb2c3e 100644 --- a/hadrian/src/Rules/Library.hs +++ b/hadrian/src/Rules/Library.hs @@ -11,7 +11,7 @@ import Expression hiding (way, package) import Oracles.ModuleFiles import Packages import Rules.Gmp -import Rules.Rts (needRtsLibffiTargets) +import Rules.Register import Target import Utilities @@ -85,7 +85,7 @@ buildDynamicLibUnix root suffix dynlibpath = do dynlib <- parsePath (parseBuildLibDyn root suffix) "<dyn lib parser>" dynlibpath let context = libDynContext dynlib deps <- contextDependencies context - need =<< mapM pkgRegisteredLibraryFile deps + registerPackages deps objs <- libraryObjects context build $ target context (Ghc LinkHs $ Context.stage context) objs [dynlibpath] @@ -144,28 +144,6 @@ libraryObjects context@Context{..} = do need $ noHsObjs ++ hsObjs return (noHsObjs ++ hsObjs) --- | Return extra library targets. -extraTargets :: Context -> Action [FilePath] -extraTargets context - | package context == rts = needRtsLibffiTargets (Context.stage context) - | otherwise = return [] - --- | Given a library 'Package' this action computes all of its targets. Needing --- all the targets should build the library such that it is ready to be --- registered into the package database. --- See 'packageTargets' for the explanation of the @includeGhciLib@ parameter. -libraryTargets :: Bool -> Context -> Action [FilePath] -libraryTargets includeGhciLib context@Context {..} = do - libFile <- pkgLibraryFile context - ghciLib <- pkgGhciLibraryFile context - ghci <- if includeGhciLib && not (wayUnit Dynamic way) - then interpretInContext context $ getContextData buildGhciLib - else return False - extra <- extraTargets context - return $ [ libFile ] - ++ [ ghciLib | ghci ] - ++ extra - -- | Coarse-grain 'need': make sure all given libraries are fully built. needLibrary :: [Context] -> Action () needLibrary cs = need =<< concatMapM (libraryTargets True) cs @@ -270,4 +248,4 @@ parseLibDynFilename ext = do -- | Get the package identifier given the package name and version. pkgId :: String -> [Integer] -> String -pkgId name version = name ++ "-" ++ intercalate "." (map show version)
\ No newline at end of file +pkgId name version = name ++ "-" ++ intercalate "." (map show version) |