本文介绍了cabal沙箱诉全球包数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在cabal沙盒中安装时,cabal仍将使用全局程序包db中的程序包(特别是来自Haskell平台的程序包)。这可能导致安装冲突。是否可以配置cabal忽略全局包db?



我看到相应的功能已在

您应该可以通过 cabal configure --package-db 标志,记录如下:

特别是,您可以将它传递给清除,然后传递它只是沙箱分贝。



这些都在文章。

When installing inside a cabal sandbox, cabal will still use packages from the global package db (in particular, packages which came from the Haskell Platform). This can lead to install conflicts. Is it possible to configure cabal to ignore the global package db?

I see the corresponding feature has been implemented in ghc itself, via a -no-global-package-db option (see https://ghc.haskell.org/trac/ghc/ticket/5977), and ghc-pkg will ignore the global package db if you do not pass it the --global flag. Is there a way to configure cabal similarly?

Also, there's a closed issue against cabal implying the opposite behavior (rebuilding everything instead of using packages from the installed Haskell Platform), so I'm not sure if this behavior has changed over time; see https://github.com/haskell/cabal/issues/1695

解决方案

You should be able to pass cabal configure the --package-db flag, documented like so:

So in particular, you can pass it clear and then pass it just the sandbox db.

This is all discussed in wonderful detail in the Storage and Interpretation of Cabalized Packages article.

这篇关于cabal沙箱诉全球包数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 08:24