[commit: ghc] master: Drop nonCabalContext, since all GHC packages now come with Cabal files (e174dca)

git at git.haskell.org git at git.haskell.org
Tue Oct 23 20:19:05 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e174dca4d5c682369c1e33b4849e949b329fdae0/ghc

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

commit e174dca4d5c682369c1e33b4849e949b329fdae0
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Aug 26 15:12:06 2018 +0100

    Drop nonCabalContext, since all GHC packages now come with Cabal files


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

e174dca4d5c682369c1e33b4849e949b329fdae0
 src/GHC.hs                   |  8 +-------
 src/Rules.hs                 | 10 +++++-----
 src/Settings/Builders/Ghc.hs |  3 +--
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/GHC.hs b/src/GHC.hs
index b3002b8..c5fd1a3 100644
--- a/src/GHC.hs
+++ b/src/GHC.hs
@@ -12,7 +12,7 @@ module GHC (
     testsuitePackages,
 
     -- * Package information
-    programName, nonCabalContext, nonHsMainPackage, autogenPath, installStage,
+    programName, nonHsMainPackage, autogenPath, installStage,
 
     -- * Miscellaneous
     programPath, buildDll0, rtsContext, rtsBuildPath, libffiContext,
@@ -157,12 +157,6 @@ programPath context at Context {..} = do
     pgm  <- programName context
     return $ path -/- pgm <.> exe
 
--- TODO: This is no longer true -- both @hp2ps@ and @touchy@ appear to have been
--- Cabal-ised, so we need to drop these special cases.
--- | Some contexts are special: their packages do not have @.cabal@ metadata.
-nonCabalContext :: Context -> Bool
-nonCabalContext Context {..} = (package `elem` [hp2ps, touchy])
-
 -- | Some program packages should not be linked with Haskell main function.
 nonHsMainPackage :: Package -> Bool
 nonHsMainPackage = (`elem` [ghc, hp2ps, iserv, touchy, unlit])
diff --git a/src/Rules.hs b/src/Rules.hs
index 3786d99..93b8592 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -72,11 +72,11 @@ packageTargets includeGhciLib stage pkg = do
     else if isLibrary pkg
         then do -- Collect all targets of a library package.
             let pkgWays = if pkg == rts then getRtsWays else getLibraryWays
-            ways    <- interpretInContext context pkgWays
-            libs    <- mapM (pkgLibraryFile . Context stage pkg) ways
-            more    <- libraryTargets includeGhciLib context
-            setup   <- pkgSetupConfigFile context
-            return $ [ setup | not (nonCabalContext context) ] ++ libs ++ more
+            ways  <- interpretInContext context pkgWays
+            libs  <- mapM (pkgLibraryFile . Context stage pkg) ways
+            more  <- libraryTargets includeGhciLib context
+            setup <- pkgSetupConfigFile context
+            return $ [setup] ++ libs ++ more
         else do -- The only target of a program package is the executable.
             prgContext <- programContext stage pkg
             prgPath    <- programPath prgContext
diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs
index a018360..49bfbd6 100644
--- a/src/Settings/Builders/Ghc.hs
+++ b/src/Settings/Builders/Ghc.hs
@@ -133,5 +133,4 @@ includeGhcArgs = do
             , cIncludeArgs
             , arg $      "-I" ++ root -/- generatedDir
             , arg $ "-optc-I" ++ root -/- generatedDir
-            , (not $ nonCabalContext context) ?
-              pure [ "-optP-include", "-optP" ++ autogen -/- "cabal_macros.h" ] ]
+            , pure [ "-optP-include", "-optP" ++ autogen -/- "cabal_macros.h" ] ]



More information about the ghc-commits mailing list