summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-03-22 16:14:29 +0000
committerBen Gamari <ben@smart-cactus.org>2023-05-16 07:56:09 -0400
commitf70b9c499594011d95657c8fb84ce6c29bb6aafa (patch)
tree5df17d0ce140c17238ef140976bb9d14348fed70
parent4532771a48e5b53af34521056ab2ad8e3acbee31 (diff)
downloadhaskell-f70b9c499594011d95657c8fb84ce6c29bb6aafa.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 (cherry picked from commit d7a768a415c3bd575a20b20ae9a3953aa5886ed7)
-rw-r--r--docs/index.html.in (renamed from docs/index.html)2
-rw-r--r--hadrian/src/Rules/Documentation.hs2
-rw-r--r--hadrian/src/Rules/Generate.hs5
3 files changed, 5 insertions, 4 deletions
diff --git a/docs/index.html b/docs/index.html.in
index a4b65dcf7c..19f3dc6ce3 100644
--- a/docs/index.html
+++ b/docs/index.html.in
@@ -39,7 +39,7 @@
<LI>
<P>
- <B><A HREF="libraries/ghc/index.html">GHC API</A></B>
+ <B><A HREF="libraries/ghc-@LIBRARY_ghc_VERSION@/index.html">GHC API</A></B>
</P>
<P>
Documentation for the GHC API.
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs
index 9beef97c79..331a459849 100644
--- a/hadrian/src/Rules/Documentation.hs
+++ b/hadrian/src/Rules/Documentation.hs
@@ -192,7 +192,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 0a27d24180..9efecaa57d 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -304,10 +304,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 ()
@@ -336,6 +336,7 @@ templateRules = do
templateRule "libraries/libiserv/libiserv.cabal" $ projectVersion
templateRule "libraries/template-haskell/template-haskell.cabal" $ projectVersion
templateRule "libraries/prologue.txt" $ packageVersions
+ templateRule "docs/index.html" $ packageVersions
-- Generators