diff options
-rw-r--r-- | hadrian/src/Rules/Documentation.hs | 10 | ||||
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs index 3c31823889..27aece61d2 100644 --- a/hadrian/src/Rules/Documentation.hs +++ b/hadrian/src/Rules/Documentation.hs @@ -78,6 +78,8 @@ needDocDeps = do , ghci , libiserv , compiler + , ghcHeap + , templateHaskell ] need templatedCabalFiles @@ -102,8 +104,6 @@ documentationRules = do "docs" ~> do root <- buildRoot - needDocDeps - doctargets <- ghcDocs =<< flavour let html = htmlRoot -/- "index.html" -- also implies "docs-haddock" archives = map pathArchive docPaths @@ -203,6 +203,9 @@ buildSphinxHtml path = do root -/- htmlRoot -/- path -/- "index.html" %> \file -> do let dest = takeDirectory file rstFilesDir = pathPath path + + needDocDeps + rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"] need (map (rstFilesDir -/-) rstFiles) build $ target docContext (Sphinx HtmlMode) [pathPath path] [dest] @@ -314,6 +317,9 @@ buildSphinxPdf :: FilePath -> Rules () buildSphinxPdf path = do root <- buildRootRules root -/- pdfRoot -/- path <.> "pdf" %> \file -> do + + needDocDeps + withTempDir $ \dir -> do let rstFilesDir = pathPath path rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"] diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index f17ff0eb21..a37d69d7d1 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -13,6 +13,8 @@ import Hadrian.Oracles.TextFile (lookupSystemConfig) import Oracles.Flag import Oracles.ModuleFiles import Oracles.Setting +import Hadrian.Haskell.Cabal.Type (PackageData(version)) +import Hadrian.Oracles.Cabal (readPackageData) import Packages import Rules.Libffi import Settings @@ -303,6 +305,13 @@ rtsCabalFlags = mconcat where flag = interpolateCabalFlag +packageVersions :: Interpolations +packageVersions = foldMap f [ base, ghcPrim, ghc, cabal, templateHaskell, ghcCompact, array ] + where + f :: Package -> Interpolations + f pkg = interpolateVar var $ show . version <$> readPackageData pkg + where var = "LIBRARY_" <> pkgName pkg <> "_VERSION" + templateRule :: FilePath -> Interpolations -> Rules () templateRule outPath interps = do outPath %> \_ -> do @@ -328,6 +337,7 @@ templateRules = do templateRule "utils/ghc-pkg/ghc-pkg.cabal" $ projectVersion templateRule "libraries/libiserv/libiserv.cabal" $ projectVersion templateRule "libraries/template-haskell/template-haskell.cabal" $ projectVersion + templateRule "libraries/prologue.txt" $ packageVersions -- Generators |