[commit: ghc] wip/nfs-locking: LIB_NAME, PACKAGE_KEY are now COMPONENT_ID (4758a21)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:11:40 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/4758a21d2a9441d5dadf9b40b578c2c8e55773e8/ghc

>---------------------------------------------------------------

commit 4758a21d2a9441d5dadf9b40b578c2c8e55773e8
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Dec 16 01:56:05 2015 +0100

    LIB_NAME, PACKAGE_KEY are now COMPONENT_ID
    
    Since GHC commit 6338a1cc6df2c7fd8a62eeb4c5240dd90ee74a6c.


>---------------------------------------------------------------

4758a21d2a9441d5dadf9b40b578c2c8e55773e8
 cfg/system.config.in         | 12 ++++++------
 src/Oracles/Config/Flag.hs   |  4 ++--
 src/Oracles/PackageData.hs   |  6 ++----
 src/Rules.hs                 |  6 +++---
 src/Settings/Builders/Ghc.hs | 16 ++++++++--------
 5 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/cfg/system.config.in b/cfg/system.config.in
index 09ea1fa..60dae28 100644
--- a/cfg/system.config.in
+++ b/cfg/system.config.in
@@ -45,12 +45,12 @@ ar-supports-at-file = @ArSupportsAtFile@
 # Build options:
 #===============
 
-supports-package-key = @SUPPORTS_PACKAGE_KEY@
-solaris-broken-shld  = @SOLARIS_BROKEN_SHLD@
-split-objects-broken = @SplitObjsBroken@
-ghc-unregisterised   = @Unregisterised@
-ghc-source-path      = @hardtop@
-leading-underscore   = @LeadingUnderscore@
+supports-component-id = @SUPPORTS_COMPONENT_ID@
+solaris-broken-shld   = @SOLARIS_BROKEN_SHLD@
+split-objects-broken  = @SplitObjsBroken@
+ghc-unregisterised    = @Unregisterised@
+ghc-source-path       = @hardtop@
+leading-underscore    = @LeadingUnderscore@
 
 # Information about build, host and target systems:
 #==================================================
diff --git a/src/Oracles/Config/Flag.hs b/src/Oracles/Config/Flag.hs
index f352ae3..631a6fc 100644
--- a/src/Oracles/Config/Flag.hs
+++ b/src/Oracles/Config/Flag.hs
@@ -16,7 +16,7 @@ data Flag = ArSupportsAtFile
           | LeadingUnderscore
           | SolarisBrokenShld
           | SplitObjectsBroken
-          | SupportsPackageKey
+          | SupportsComponentId
 
 -- Note, if a flag is set to empty string we treat it as set to NO. This seems
 -- fragile, but some flags do behave like this, e.g. GccIsClang.
@@ -31,7 +31,7 @@ flag f = do
         LeadingUnderscore  -> "leading-underscore"
         SolarisBrokenShld  -> "solaris-broken-shld"
         SplitObjectsBroken -> "split-objects-broken"
-        SupportsPackageKey -> "supports-package-key"
+        SupportsComponentId -> "supports-component-id"
     value <- askConfigWithDefault key . putError
         $ "\nFlag '" ++ key ++ "' not set in configuration files."
     unless (value == "YES" || value == "NO" || value == "") . putError
diff --git a/src/Oracles/PackageData.hs b/src/Oracles/PackageData.hs
index e4aae0a..8a067b9 100644
--- a/src/Oracles/PackageData.hs
+++ b/src/Oracles/PackageData.hs
@@ -16,8 +16,7 @@ import qualified Data.HashMap.Strict as Map
 -- such as 'path_MODULES = Data.Array Data.Array.Base ...'.
 -- pkgListData Modules therefore returns ["Data.Array", "Data.Array.Base", ...]
 data PackageData = BuildGhciLib FilePath
-                 | LibName      FilePath
-                 | PackageKey   FilePath
+                 | ComponentId  FilePath
                  | Synopsis     FilePath
                  | Version      FilePath
 
@@ -55,8 +54,7 @@ askPackageData path key = do
 pkgData :: PackageData -> Action String
 pkgData packageData = case packageData of
     BuildGhciLib path -> askPackageData path "BUILD_GHCI_LIB"
-    LibName      path -> askPackageData path "LIB_NAME"
-    PackageKey   path -> askPackageData path "PACKAGE_KEY"
+    ComponentId  path -> askPackageData path "COMPONENT_ID"
     Synopsis     path -> askPackageData path "SYNOPSIS"
     Version      path -> askPackageData path "VERSION"
 
diff --git a/src/Rules.hs b/src/Rules.hs
index 2a6bd59..90769c1 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -16,15 +16,15 @@ generateTargets = action $ do
         libTargets <- fmap concat . forM libPkgs $ \pkg -> do
             let target    = PartialTarget stage pkg
                 buildPath = targetPath stage pkg -/- "build"
-            libName     <- interpretPartial target $ getPkgData LibName
+            compId      <- interpretPartial target $ getPkgData ComponentId
             needGhciLib <- interpretPartial target $ getPkgData BuildGhciLib
             needHaddock <- interpretPartial target buildHaddock
             ways        <- interpretPartial target getWays
-            let ghciLib = buildPath -/- "HS" ++ libName <.> "o"
+            let ghciLib = buildPath -/- "HS" ++ compId <.> "o"
                 haddock = pkgHaddockFile pkg
             libs <- fmap concat . forM ways $ \way -> do
                 extension <- libsuf way
-                let name = buildPath -/- "libHS" ++ libName
+                let name = buildPath -/- "libHS" ++ compId
                 dll0 <- needDll0 stage pkg
                 return $ [ name <.> extension ]
                       ++ [ name ++ "-0" <.> extension | dll0 ]
diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs
index 247a114..50973c0 100644
--- a/src/Settings/Builders/Ghc.hs
+++ b/src/Settings/Builders/Ghc.hs
@@ -91,11 +91,11 @@ wayGhcArgs = do
 -- TODO: Improve handling of "-hide-all-packages"
 packageGhcArgs :: Args
 packageGhcArgs = do
-    stage              <- getStage
-    pkg                <- getPackage
-    supportsPackageKey <- getFlag SupportsPackageKey
-    pkgKey             <- getPkgData PackageKey
-    pkgDepIds          <- getPkgDataList DepIds
+    stage               <- getStage
+    pkg                 <- getPackage
+    supportsComponentId <- getFlag SupportsComponentId
+    compId              <- getPkgData ComponentId
+    pkgDepIds           <- getPkgDataList DepIds
     mconcat
         [ not (pkg == deriveConstants || pkg == genapply
             || pkg == genprimopcode   || pkg == hp2ps) ?
@@ -103,9 +103,9 @@ packageGhcArgs = do
         , arg "-no-user-package-db"
         , stage0 ? arg "-package-db libraries/bootstrapping.conf"
         , isLibrary pkg ?
-          if supportsPackageKey || stage /= Stage0
-          then arg $ "-this-package-key " ++ pkgKey
-          else arg $ "-package-name "     ++ pkgKey
+          if supportsComponentId || stage /= Stage0
+          then arg $ "-this-package-key " ++ compId
+          else arg $ "-package-name "     ++ compId
         , append $ map ("-package-id " ++) pkgDepIds ]
 
 -- TODO: Improve handling of "cabal_macros.h"



More information about the ghc-commits mailing list