[commit: ghc] wip/hadrian-ghc-in-ghci: Make libsuf aware of Stage so that it gets the suffix right (b2be17c)
git at git.haskell.org
git at git.haskell.org
Sun Mar 10 14:31:38 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/hadrian-ghc-in-ghci
Link : http://ghc.haskell.org/trac/ghc/changeset/b2be17ce41f85e9772640f77254f8143e97d2fa2/ghc
>---------------------------------------------------------------
commit b2be17ce41f85e9772640f77254f8143e97d2fa2
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date: Sat Mar 9 10:45:00 2019 +0000
Make libsuf aware of Stage so that it gets the suffix right
>---------------------------------------------------------------
b2be17ce41f85e9772640f77254f8143e97d2fa2
hadrian/src/Context.hs | 2 +-
hadrian/src/Oracles/Setting.hs | 12 ++++++++----
hadrian/src/Rules/Libffi.hs | 2 +-
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/hadrian/src/Context.hs b/hadrian/src/Context.hs
index cf6381c..d8f24fe 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 at .
pkgLibraryFile :: Context -> Action FilePath
pkgLibraryFile context at 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 2a88df4..4666539 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 at .
-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 64f6303..908b45a 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
More information about the ghc-commits
mailing list