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

cabal install --lib doesn't work any more with GHC 9.2 #7819

Closed
wz1000 opened this issue Nov 15, 2021 · 11 comments
Closed

cabal install --lib doesn't work any more with GHC 9.2 #7819

wz1000 opened this issue Nov 15, 2021 · 11 comments

Comments

@wz1000
Copy link

wz1000 commented Nov 15, 2021

As mentioned by the release notes of GHC 9.2.1, GHC now respects the XDG specification for its user data directory (which includes package environments as well as GHCi configuration files). Howver, cabal hasn't been updated to reflect these changes yet, which means it still writes package environments to ~/.ghc, instead of $XDG_DATA_HOME.

This is the function in cabal that needs to be updated:

getGhcAppDir :: IO FilePath

The change to GHC was introduced in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4567

@Mikolaj
Copy link
Member

Mikolaj commented Nov 15, 2021

We are working on it for a decade now: #680 (three digits!), but I guess it's time to speed it up.

@phadej
Copy link
Collaborator

phadej commented Nov 15, 2021

This is not about #680, but about fixing

-- | Return the 'FilePath' to the GHC application data directory.
--
-- @since 3.4.0.0
getGhcAppDir :: IO FilePath
getGhcAppDir = getAppUserDataDirectory "ghc"

which would need to take the GHC version now.

@Mikolaj
Copy link
Member

Mikolaj commented Nov 15, 2021

Right, so one option is to use XDG when working with [edit: new versions of] GHC, but not use it when doing our own cabal things. And it seems we have good support for this distinction?

Edit: and we have no choice other than mixing XDG and no-XDG, because old GHCs don't use XDG, right? :(

@phadej
Copy link
Collaborator

phadej commented Nov 15, 2021

The release notes for 9.2.1 say:

GHC now follows by default the XDG Base Directory Specification. If $HOME/.ghc is found it will fallback to the old paths to give you time to migrate. This fallback will be removed in three releases.

So why 9.2.1 doesn't work?

@phadej
Copy link
Collaborator

phadej commented Nov 15, 2021

This is bug in GHC, I opened an upstream issue https://gitlab.haskell.org/ghc/ghc/-/issues/20684

@Mikolaj
Copy link
Member

Mikolaj commented Jan 29, 2022

This seems to fix the problem, but I'm not 100% sure it's going to be backported to 9.2: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7010

@Mikolaj
Copy link
Member

Mikolaj commented Feb 1, 2022

Good news, the GHC fix has just been backported and merged to GHC 9.2.2 (to be released).

@Mikolaj
Copy link
Member

Mikolaj commented Feb 1, 2022

It seems we don't need to do anything, but let's keep this issue open until GHC 9.2.2 and possibly until somebody verifies it works.

@wz1000
Copy link
Author

wz1000 commented Feb 1, 2022

It would still be good to move towards respecting the XDG spec, but it is not a pressing concern as of now.

@Mikolaj
Copy link
Member

Mikolaj commented Feb 1, 2022

It would still be good to move towards respecting the XDG spec, but it is not a pressing concern as of now.

Yes, if anybody would like to help, that'd be awesome. We track that work in another ticket mentioned above.

@gbaz
Copy link
Collaborator

gbaz commented Feb 10, 2022

The fix for this is in the next ghc -- 9.2.2.

@gbaz gbaz closed this as completed Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants