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

Default environment written to wrong place #7943

Closed
josephcsible opened this issue Feb 1, 2022 · 3 comments
Closed

Default environment written to wrong place #7943

josephcsible opened this issue Feb 1, 2022 · 3 comments

Comments

@josephcsible
Copy link

Describe the bug
Cabal writes the environment file under a subdirectory of ~/.ghc/, which then goes unused because GHC looks for it under a subdirectory of ~/.local/share/ghc/.

To Reproduce
Steps to reproduce the behavior:

docker run -it haskell:9.2 bash  # optional; the problem also happens with a regular ghcup install
cabal v2-update
cabal v2-install --lib contravariant
ghci
import Data.Functor.Contravariant.Divisible

Expected behavior
The import should succeed, since the package it's in was just installed and added to the default environment.

System information

  • Operating system: Debian buster
  • cabal 3.6.2.0, ghc 9.2.1

Additional context
This problem doesn't occur with older versions of GHC. Also, I discovered I can work around it by symlinking ~/.local/share/ghc/ to ~/.ghc/.

@gbaz
Copy link
Collaborator

gbaz commented Feb 1, 2022

cf #7819 -- its a bug in ghc which will hopefully be fixed in the next 9.2.x release, but arguably its unclear if cabal should also do something on top of that

@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. Let's keep #7819 open until GHC 9.2.2 is released and possibly until somebody verifies it works.

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

3 participants