summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-03-09 10:45:00 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2019-03-09 10:45:00 +0000
commitb2be17ce41f85e9772640f77254f8143e97d2fa2 (patch)
tree68d6a34266aa421fb4bd2a9b599ee369e1a204ad
parentd1688d82429c02959e848886c834a947f0ddec69 (diff)
downloadhaskell-wip/hadrian-ghc-in-ghci.tar.gz
Make libsuf aware of Stage so that it gets the suffix rightwip/hadrian-ghc-in-ghci
-rw-r--r--hadrian/src/Context.hs2
-rw-r--r--hadrian/src/Oracles/Setting.hs12
-rw-r--r--hadrian/src/Rules/Libffi.hs2
3 files changed, 10 insertions, 6 deletions
diff --git a/hadrian/src/Context.hs b/hadrian/src/Context.hs
index cf6381cb69..d8f24fe1fc 100644
--- a/hadrian/src/Context.hs
+++ b/hadrian/src/Context.hs
@@ -85,7 +85,7 @@ pkgHaddockFile Context {..} = do
-- @_build/stage1/libraries/array/build/libHSarray-0.5.1.0.a@.
pkgLibraryFile :: Context -> Action FilePath
pkgLibraryFile context@Context {..} = do
- extension <- libsuf way
+ extension <- libsuf stage way
pkgFile context "libHS" extension
-- | Path to the GHCi library file of a given 'Context', e.g.:
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs
index 2a88df42f9..4666539f93 100644
--- a/hadrian/src/Oracles/Setting.hs
+++ b/hadrian/src/Oracles/Setting.hs
@@ -210,6 +210,10 @@ ghcCanonVersion = do
topDirectory :: Action FilePath
topDirectory = fixAbsolutePathOnWindows =<< setting GhcSourcePath
+ghcVersionStage :: Stage -> Action String
+ghcVersionStage Stage0 = setting GhcVersion
+ghcVersionStage _ = setting ProjectVersion
+
-- | The file suffix used for libraries of a given build 'Way'. For example,
-- @_p.a@ corresponds to a static profiled library, and @-ghc7.11.20141222.so@
-- is a dynamic vanilly library. Why do we need GHC version number in the
@@ -219,11 +223,11 @@ topDirectory = fixAbsolutePathOnWindows =<< setting GhcSourcePath
-- live in their own per-package directory and hence do not need a unique
-- filename. We also need to respect the system's dynamic extension, e.g. @.dll@
-- or @.so@.
-libsuf :: Way -> Action String
-libsuf way
+libsuf :: Stage -> Way -> Action String
+libsuf st way
| not (wayUnit Dynamic way) = return (waySuffix way ++ ".a") -- e.g., _p.a
| otherwise = do
extension <- setting DynamicExtension -- e.g., .dll or .so
- version <- setting ProjectVersion -- e.g., 7.11.20141222
+ version <- ghcVersionStage st -- e.g. 8.4.4 or 8.9.xxxx
let suffix = waySuffix (removeWayUnit Dynamic way)
- return (suffix ++ "-ghc" ++ "8.4.4" ++ extension)
+ return (suffix ++ "-ghc" ++ version ++ extension)
diff --git a/hadrian/src/Rules/Libffi.hs b/hadrian/src/Rules/Libffi.hs
index 64f63039eb..908b45a683 100644
--- a/hadrian/src/Rules/Libffi.hs
+++ b/hadrian/src/Rules/Libffi.hs
@@ -60,7 +60,7 @@ libffiLibrary = "inst/lib/libffi.a"
rtsLibffiLibrary :: Stage -> Way -> Action FilePath
rtsLibffiLibrary stage way = do
name <- libffiLibraryName
- suf <- libsuf way
+ suf <- libsuf stage way
rtsPath <- rtsBuildPath stage
return $ rtsPath -/- "lib" ++ name ++ suf