Open jchia opened 5 months ago
I notice that in 9.4.8 & 9.6.4, the package database info uses pkgroot
as a variable to describe directories like haddock-html
, but not 9.2.8.
'pkgroot' does not appear in the hoogle codebase, so perhaps hoogle does not do the necessary string interpolation with pkgroot, resulting in the failure to find the documentation? If so, then there are 2 problems:
I suppose a deeper problem is the lack of an API/library to extract package database information. (AFAIK there is none.)
19:17 ~$ ghc-pkg-9.2.8 --global -v2 describe base-4.16.4.0 | egrep -A1 'haddock-html|^pkgroot'
Timestamp 2023-05-28 17:36:43.842187821 UTC for /home/jchia/.ghcup/ghc/9.2.8/lib/ghc-9.2.8/package.conf.d/package.cache
haddock-html:
/home/jchia/.ghcup/ghc/9.2.8/share/doc/ghc-9.2.8/html/libraries/base-4.16.4.0
pkgroot: "/home/jchia/.ghcup/ghc/9.2.8/lib/ghc-9.2.8"
19:17 ~$ ghc-pkg-9.6.4 --global -v2 describe base-4.18.2.0 | egrep -A1 'haddock-html|^pkgroot'
Timestamp 2024-01-23 05:17:12.998622263 UTC for /home/jchia/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/lib/package.conf.d/package.cache
haddock-html:
${pkgroot}/../../../share/doc/ghc-9.6.4/html/libraries/base-4.18.2.0
pkgroot: "/home/jchia/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/lib"
When I manually hacked the .conf files to interpolate pkgconf, the problem went away:
$ pwd
/home/jchia/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/lib/package.conf.d
$ sed -i 's/${pkgroot}/\/home\/jchia\/.ghcup\/ghc\/9.6.4\/lib\/ghc-9.6.4\/lib/' *.conf
I suppose now one of the main questions is whose job it is to do the interpolation of pkgroot, the GHC installation procedure, ghc-pkg or tools that use ghc-pkg?
Attempting to generate database for local GHC packages fails on GHC versions 9.4.8 & 9.6.4. 9.2.8 is fine.
All the GHC versions in my tests were installed using GHCup. The
hoogle
is the latest version installed usingcabal install hoogle
.hoogle generate -l
fails to find the documentation for built-in packages likebase
andbinary
under the problematic GHC versions.hoogle generate -h
seems to find the documentation when given thehtml/libraries
directory associated with GHC installation, but the resulting database is unsuitable for serving as the generated documentation URLs have wrong paths, so-h
is not a suitable workaround.