From 31e3f332ea027ec516ec94d034a8763c153ac6cb Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 16 Sep 2025 16:52:06 +0100 Subject: [PATCH] Expand ${pkgroot} variable when reading haddock-html field from ghc-pkg This fixes #11217 No test, as it is difficult to test since you need to: 1. Ensure there is a package registration with ${pkgroot} 2. Check the existence of a certain link in the generated HTML. --- Cabal/src/Distribution/Simple/Program/HcPkg.hs | 2 +- changelog.d/pr-11218.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog.d/pr-11218.md diff --git a/Cabal/src/Distribution/Simple/Program/HcPkg.hs b/Cabal/src/Distribution/Simple/Program/HcPkg.hs index a494bc63f02..7ad7eba4ebc 100644 --- a/Cabal/src/Distribution/Simple/Program/HcPkg.hs +++ b/Cabal/src/Distribution/Simple/Program/HcPkg.hs @@ -351,7 +351,7 @@ mungePackagePaths pkgroot pkginfo = , libraryDynDirs = mungePaths (libraryDynDirs pkginfo) , frameworkDirs = mungePaths (frameworkDirs pkginfo) , haddockInterfaces = mungePaths (haddockInterfaces pkginfo) - , haddockHTMLs = mungeUrls (haddockHTMLs pkginfo) + , haddockHTMLs = mungePaths (mungeUrls (haddockHTMLs pkginfo)) } where mungePaths = map mungePath diff --git a/changelog.d/pr-11218.md b/changelog.d/pr-11218.md new file mode 100644 index 00000000000..5b69bbb59ee --- /dev/null +++ b/changelog.d/pr-11218.md @@ -0,0 +1,6 @@ +synopsis: Fix links to installed documentation when running `cabal haddock` +packages: Cabal +prs: #11218 + +Links to installed documentation (i.e. for base) from generated haddock should +now work.