如果发生故障,如何清理nix风格的集团?

时间:2019-07-26 14:22:16

标签: cabal cabal-new

回想一下以前使用nix式阴谋集团的日子。 当我们进入阴间地狱时,我们可以删除2个目录 .cabal.ghc,然后在干净的阴谋环境中重新启动。

现在,我认为,在我的一台机器上出现了问题,并且我的数码相机风格 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版本的已安装软件包,因此,我不想完全删除.cabal.ghc目录。

1 个答案:

答案 0 :(得分:1)

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

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

相关问题