diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2023-03-22 16:14:29 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-14 04:18:28 -0400 |
commit | d7a768a415c3bd575a20b20ae9a3953aa5886ed7 (patch) | |
tree | 88a8f7c0d1c91bf7446ac44858a59e796a9678f6 | |
parent | a34aa8da1293f997ce9212ccdc2ec56df4a2e9c1 (diff) | |
download | haskell-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
-rw-r--r-- | docs/index.html.in (renamed from docs/index.html) | 2 | ||||
-rw-r--r-- | hadrian/src/Rules/Documentation.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 5 |
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 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 |