[commit: ghc] wip/nfs-locking: Build mkUserGuidePart with stage-0 (a86f2b1)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:41:32 UTC 2017


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

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

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

commit a86f2b1e97fb7fa0ef08327f083049a41b278513
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Oct 8 15:10:43 2016 -0400

    Build mkUserGuidePart with stage-0
    
    This addresses GHC #12619, allowing the users guide to be built with
    only the stage 0 compiler.


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

a86f2b1e97fb7fa0ef08327f083049a41b278513
 src/Builder.hs          | 1 +
 src/GHC.hs              | 5 ++++-
 src/Settings/Default.hs | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Builder.hs b/src/Builder.hs
index 6f892f2..09b87cb 100644
--- a/src/Builder.hs
+++ b/src/Builder.hs
@@ -104,6 +104,7 @@ builderPath builder = case builderProvenance builder of
     Just context
       | Just path <- programPath context -> return path
       | otherwise                        ->
+        -- TODO: Make builderPath total.
         error $ "Cannot determine builderPath for " ++ show builder
              ++ " in context " ++ show context
     Nothing -> case builder of
diff --git a/src/GHC.hs b/src/GHC.hs
index 0bfd131..3521e54 100644
--- a/src/GHC.hs
+++ b/src/GHC.hs
@@ -102,7 +102,10 @@ ghcSplit = "inplace/lib/bin/ghc-split"
 programPath :: Context -> Maybe FilePath
 programPath context at Context {..}
     | package == ghc = Just . inplaceProgram $ "ghc-stage" ++ show (fromEnum stage + 1)
-    | package `elem` [checkApiAnnotations, ghcTags, haddock, mkUserGuidePart] =
+    | package `elem` [mkUserGuidePart] =
+        case stage of Stage0 -> Just . inplaceProgram $ pkgNameString package
+                      _      -> Nothing
+    | package `elem` [checkApiAnnotations, ghcTags, haddock] =
         case stage of Stage2 -> Just . inplaceProgram $ pkgNameString package
                       _      -> Nothing
     | package `elem` [touchy, unlit] = case stage of
diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs
index e35fea0..4588c4b 100644
--- a/src/Settings/Default.hs
+++ b/src/Settings/Default.hs
@@ -108,7 +108,7 @@ packagesStage0 = mconcat
              , ghcPkg, hsc2hs, hoopl, hpc, templateHaskell, transformers ]
     -- the stage0 predicate makes sure these packages are built only in Stage0
     , stage0 ? append [ deriveConstants, dllSplit, genapply, genprimopcode
-                      , hp2ps, unlit ]
+                      , hp2ps, unlit, mkUserGuidePart ]
     , stage0 ? windowsHost ? append [touchy]
     , notM windowsHost ? notM iosHost ? append [terminfo] ]
 
@@ -127,7 +127,7 @@ packagesStage1 = mconcat
 -- in Stage2 and Stage3. Can we check this in compile time?
 packagesStage2 :: Packages
 packagesStage2 = mconcat
-    [ append [checkApiAnnotations, ghcTags, mkUserGuidePart]
+    [ append [checkApiAnnotations, ghcTags ]
     , buildHaddock flavour ? append [haddock] ]
 
 -- TODO: What about profilingDynamic way? Do we need platformSupportsSharedLibs?



More information about the ghc-commits mailing list