summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-03-22 16:14:29 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-04-14 04:18:28 -0400
commitd7a768a415c3bd575a20b20ae9a3953aa5886ed7 (patch)
tree88a8f7c0d1c91bf7446ac44858a59e796a9678f6 /hadrian
parenta34aa8da1293f997ce9212ccdc2ec56df4a2e9c1 (diff)
downloadhaskell-d7a768a415c3bd575a20b20ae9a3953aa5886ed7.tar.gz
docs: Generate docs/index.html with version number
* Generate docs/index.html to include the version of the ghc library * This also fixes the packageVersions interpolations which were - Missing an interpolation for `LIBRARY_ghc_VERSION` - Double quoting the version so that "9.7" was being inserted. Fixes #23121
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Rules/Documentation.hs2
-rw-r--r--hadrian/src/Rules/Generate.hs5
2 files changed, 4 insertions, 3 deletions
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs
index c982642b32..6e6654278f 100644
--- a/hadrian/src/Rules/Documentation.hs
+++ b/hadrian/src/Rules/Documentation.hs
@@ -193,7 +193,7 @@ buildHtmlDocumentation = do
| SphinxHTML `Set.member` doctargets ]
need $ map ((root -/-) . pathIndex) targets
- copyFileUntracked "docs/index.html" file
+ copyFile "docs/index.html" file
-- | Compile a Sphinx ReStructured Text package to HTML.
buildSphinxHtml :: FilePath -> Rules ()
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 1e905438eb..fea40d6fb0 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -305,10 +305,10 @@ rtsCabalFlags = mconcat
flag = interpolateCabalFlag
packageVersions :: Interpolations
-packageVersions = foldMap f [ base, ghcPrim, ghc, cabal, templateHaskell, ghcCompact, array ]
+packageVersions = foldMap f [ base, ghcPrim, compiler, ghc, cabal, templateHaskell, ghcCompact, array ]
where
f :: Package -> Interpolations
- f pkg = interpolateVar var $ show . version <$> readPackageData pkg
+ f pkg = interpolateVar var $ version <$> readPackageData pkg
where var = "LIBRARY_" <> pkgName pkg <> "_VERSION"
templateRule :: FilePath -> Interpolations -> Rules ()
@@ -335,6 +335,7 @@ templateRules = do
templateRule "utils/ghc-pkg/ghc-pkg.cabal" $ projectVersion
templateRule "libraries/template-haskell/template-haskell.cabal" $ projectVersion
templateRule "libraries/prologue.txt" $ packageVersions
+ templateRule "docs/index.html" $ packageVersions
-- Generators