Update GHC environment location (fixes #6565) #6822
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cabal-install currently assumes that the GHC environment files are always located in
$HOME/.ghc/
. However, GHC itself doesn't query the home directory directly. Instead, it usesgetAppUserDataDirectory "ghc"
(GHC code, getAppUserDataDirectory) which happens to coincide with$HOME/.ghc/
on UNIX systems. On Windows, however, GHC ends up looking in%APPDATA%/ghc/
.As a result,
cabal install --lib
doesn't change the correct environment files on Windows.This PR changes the environment file locations to match GHC. On UNIX, there is no change since
getAppUserDataDirectory "ghc"
is defined as(</> ".ghc") <$> getHomeDirectory
. On windows, I have confirmed that cabal-install changes the correct GHC environment file with this PR.Please include the following checklist in your PR:
changelog.d
directory).