0

记住我们有尼克斯式阴谋集团之前的旧时光。当我们进入 cabal 地狱时,我们可以删除 2 个目录 .cabal.ghc重新启动干净的 cabal 环境。

现在我想,在我的一台机器上出了点问题,我的 nix 风格的 v2-cabal 存储库出现故障。

如果我这样做, cabal v2-install --dry-run directory我会得到:

Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: directory (user goal)
[__0] rejecting: directory-1.3.4.0 (constraint from user target requires
==1.3.3.2)
[__0] trying: directory-1.3.3.2
[__1] next goal: ghc (user goal)
[__1] rejecting: ghc-8.6.5, ghc-8.6.4 (constraint from user target requires
==8.6.3)
[__1] rejecting: ghc-8.6.3/installed-8.6... (conflict: directory==1.3.3.2, ghc
=> directory==1.3.3.0/installed-1.3...)
[__1] rejecting: ghc-8.6.1, ghc-8.4.4, ghc-8.4.3, ghc-8.4.1, ghc-8.2.2,
ghc-8.2.1 (constraint from user target requires ==8.6.3)
[__1] fail (backjumping, conflict set: directory, ghc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: directory, ghc

问题出在 GHC-8.6.3 上。
在另一台机器上,这工作正常,因此我认为有问题。

我怎样才能解决这个问题?删除以下目录就够了吗?

  • ~/.cabal/store/ghc-8.6.3
  • ~/.cabal/lib/x86_64-linux-ghc-8.6.3
  • ~/.cabal/share/x86_64-linux-ghc-8.6.3
  • ~/.ghc/x86_64-linux-8.6.3

是否有任何其他目录/文件,我必须删除?有没有类似 cabal v2-clean 命令的东西?

我不想删除其他 GHC 版本的已安装包,因此我不想完全删除.cabaland.ghc目录。

4

1 回答 1

1

几乎可以肯定,问题是您的全局 ghc 环境文件中有一个冲突的库:https ://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-environments

您可以手动从该文件中清除条目,或使用https://github.com/phadej/cabal-env等工具对其进行管理

于 2019-10-12T06:34:14.460 回答