From f30e4984fb048818051465698ef8e4e20dacb577 Mon Sep 17 00:00:00 2001
From: Teo Camarasu <teo.camarasu@tracsis.com>
Date: Mon, 15 Apr 2024 16:56:41 +0100
Subject: [PATCH] Fix ghc API link in docs/index.html

This was missing part of the unit ID meaning it would 404.

Resolves #24674
---
 docs/index.html.in            | 2 +-
 hadrian/src/Rules/Generate.hs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/index.html.in b/docs/index.html.in
index 19f3dc6ce393..381071998429 100644
--- a/docs/index.html.in
+++ b/docs/index.html.in
@@ -39,7 +39,7 @@
 
       <LI>
         <P>
-          <B><A HREF="libraries/ghc-@LIBRARY_ghc_VERSION@/index.html">GHC API</A></B>
+          <B><A HREF="libraries/@LIBRARY_ghc_UNIT_ID@/index.html">GHC API</A></B>
         </P>
         <P>
           Documentation for the GHC API.
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index d9f85b5efb5e..6cd663b91be6 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -360,7 +360,7 @@ templateRules = do
     , interpolateSetting "ProjectPatchLevel1" ProjectPatchLevel1
     , interpolateSetting "ProjectPatchLevel2" ProjectPatchLevel2
     ]
-  templateRule "docs/index.html" $ packageVersions
+  templateRule "docs/index.html" $ packageUnitIds Stage1
   templateRule "docs/users_guide/ghc_config.py" $ mconcat
     [ projectVersion
     , packageUnitIds Stage1
-- 
GitLab