Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #404 Accommodate ${pkgroot} and tolerate GHC errors on Windows #405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpilgrem
Copy link

@mpilgrem mpilgrem commented Jun 4, 2023

CPP is used (sorry) to tailor for Windows and GHC >= 9.0. In that case, ${pkgroot} is not expanded and the bogus prefix is stripped.

Otherwise, ${pkgroot} is expanded. For compatibility with GHC < 9.0, $topdir is still stripped, if present.

I confirm I am licensing my contribution under all licenses that apply to this project (see LICENSE) and that I have no patents covering my contribution.

…Windows

CPP is used to tailor for Windows and GHC >= 9.0. In that case, ${pkgroot} is not expanded and the bogus prefix is stripped.

Otherwise, ${pkgroot} is expanded. For compatibility with GHC < 9.0, $topdir is still stripped, if present.
-- haddock-html: ${pkgroot}/../doc/html/libraries/base-4.18.0.0
-- So, a unique approach is taken to `readGhcPkg` in that case. It assumes that
-- the `*.conf` files have not been manually corrected.
#if defined(mingw32_HOST_OS) && __GLASGOW_HASKELL__>=901

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CPP should have an upper bound, it is fixed in 9.10.1.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's a great idea to bake this logic about some broken bindists into hoogle, someone could build their own bindist which doesn't have this bug and it would be broken.

#else
-- From GHC 9.0.1, the `haddock-html` field in `*.conf` files for GHC boot
-- libraries has used `${pkgroot}`, which can be expanded in the output.
let ghcPkgArgs = ["dump", "--expand-pkgroot"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --expand-pkgroot is a good fix.

@hololeap
Copy link

hololeap commented Aug 9, 2024

I can confirm this fixes #420 on ghc-9.4.8 (gentoo linux)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants