[Git][ghc/ghc][master] hadrian: Fix links to remaining doc sites to not use the package hash for haddock links
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 1446bb03 by Zubin Duggal at 2026-08-13T10:17:48-04:00 hadrian: Fix links to remaining doc sites to not use the package hash for haddock links In 07267f79d91169f474cacc8bcd38d76a6e97887d we changed hadrian to not include the package hash in the haddock directory. This patch takes care of a few remaining links that were missed in that patch Fixes #27671 - - - - - 3 changed files: - docs/index.html.in - docs/users_guide/ghc_config.py.in - hadrian/src/Rules/Generate.hs Changes: ===================================== docs/index.html.in ===================================== @@ -39,7 +39,7 @@ <LI> <P> - <B><A HREF="libraries/@LIBRARY_ghc_UNIT_ID@/index.html">GHC API</A></B> + <B><A HREF="libraries/@LIBRARY_ghc_ID@/index.html">GHC API</A></B> </P> <P> Documentation for the GHC API. ===================================== docs/users_guide/ghc_config.py.in ===================================== @@ -17,16 +17,16 @@ else: libs_base_uri = '../libraries' -# N.B. If you add a package to this list be sure to also add a corresponding -# LIBRARY_VERSION macro call to configure.ac. +# N.B. If you add a package to this list be sure to also add it to +# 'packageIds' in hadrian/src/Rules/Generate.hs. lib_versions = { - 'base': '@LIBRARY_base_UNIT_ID@', - 'ghc-prim': '@LIBRARY_ghc_prim_UNIT_ID@', - 'template-haskell': '@LIBRARY_template_haskell_UNIT_ID@', - 'ghc-compact': '@LIBRARY_ghc_compact_UNIT_ID@', - 'ghc': '@LIBRARY_ghc_UNIT_ID@', - 'Cabal': '@LIBRARY_Cabal_UNIT_ID@', - 'array': '@LIBRARY_array_UNIT_ID@', + 'base': '@LIBRARY_base_ID@', + 'ghc-prim': '@LIBRARY_ghc_prim_ID@', + 'template-haskell': '@LIBRARY_template_haskell_ID@', + 'ghc-compact': '@LIBRARY_ghc_compact_ID@', + 'ghc': '@LIBRARY_ghc_ID@', + 'Cabal': '@LIBRARY_Cabal_ID@', + 'array': '@LIBRARY_array_ID@', } version = '@ProjectVersion@' ===================================== hadrian/src/Rules/Generate.hs ===================================== @@ -334,13 +334,15 @@ packageVersions = foldMap f [ base, ghcPrim, compiler, ghc, cabal, templateHaske f pkg = interpolateVar var $ version <$> readPackageData pkg where var = "LIBRARY_" <> escapedPkgName pkg <> "_VERSION" -packageUnitIds :: Stage -> Interpolations -packageUnitIds stage = +-- We don't want to use the hash in the html documentation because it +-- makes it harder for non-boot packages to link to boot packages, see #26635 +packageIds :: Interpolations +packageIds = foldMap f [ base, ghcPrim, compiler, ghc, cabal, templateHaskell, ghcCompact, array ] where f :: Package -> Interpolations - f pkg = interpolateVar var $ pkgUnitId stage pkg - where var = "LIBRARY_" <> escapedPkgName pkg <> "_UNIT_ID" + f pkg = interpolateVar var $ pkgSimpleIdentifier pkg + where var = "LIBRARY_" <> escapedPkgName pkg <> "_ID" escapedPkgName :: Package -> String escapedPkgName = map f . pkgName @@ -395,10 +397,10 @@ templateRules = do , interpolateSetting "ProjectPatchLevel1" ProjectPatchLevel1 , interpolateSetting "ProjectPatchLevel2" ProjectPatchLevel2 ] - templateRule "docs/index.html" $ packageUnitIds Stage1 + templateRule "docs/index.html" $ packageIds templateRule "docs/users_guide/ghc_config.py" $ mconcat [ projectVersion - , packageUnitIds Stage1 + , packageIds , interpolateSetting "LlvmMinVersion" LlvmMinVersion , interpolateSetting "LlvmMaxVersion" LlvmMaxVersion ] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1446bb039a635f2b836be19f062cbffa... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1446bb039a635f2b836be19f062cbffa... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Marge Bot (@marge-bot)