更新时间:2023-02-24 07:56:11
当尝试在其他计算机上重现此问题时,每5台计算机中只有2台出现此问题.在它们两个上,我都以相同的方式和顺序安装了cabal软件包.
When trying to reproduce this issue on other computers, only 2 out of 5 computers had this issue. On both of them I installed cabal packages in about the same way and order.
回想一下,我认为这个问题是由于某些破损的包装造成了严重破坏而引起的:
In retrospect I assume this issue arose because of some broken packages wreaking havoc:
$ ghc-pkg check
There are problems in package feed-0.3.9.2:
dependency "xml-1.3.13-dd52b1688e97a3c6cd0aa48dba7b153e" doesn't exist
There are problems in package hxt-9.3.1.3:
dependency "network-2.4.2.2-ea77cdf1bc747bc58308fdeb52745c4d" doesn't exist
There are problems in package hspec-1.8.1.1:
dependency "QuickCheck-2.6-409fcc32c191cd6e04afdebb15869820" doesn't exist
There are problems in package quickcheck-io-0.1.0:
dependency "QuickCheck-2.6-409fcc32c191cd6e04afdebb15869820" doesn't exist
There are problems in package regex-compat-0.95.1:
dependency "regex-base-0.93.2-2023953b859e6f91efe89733d2ef5421" doesn't exist
There are problems in package regex-posix-0.95.2:
dependency "regex-base-0.93.2-2023953b859e6f91efe89733d2ef5421" doesn't exist
There are problems in package hxt-9.3.1.2:
dependency "network-2.4.2.2-ea77cdf1bc747bc58308fdeb52745c4d" doesn't exist
The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
feed-0.3.9.2
hxt-9.3.1.3
hspec-1.8.1.1
quickcheck-io-0.1.0
regex-compat-0.95.1
regex-posix-0.95.2
hxt-9.3.1.2
MissingH-1.2.0.2
yesod-test-1.2.1
请注意,没有列出 pandoc
和 yaml
(我在问了问题后就安装了它,并且与 pandoc
完全一样)在那里.
Note that neither pandoc
nor yaml
(I installed it after asking the question and had the exact same issues as with pandoc
) are listed there.
对于也有类似问题的用户,请确保:
For users also having a similar problem, please ensure:
该软件包已安装,并且您不在任何未安装该软件包的沙箱中.
The package is installed and you're not inside any sandbox where the package is not installed.
在执行测试脚本的目录中,确保没有 Text/Pandoc
文件夹(或等效文件夹,具体取决于引起问题的程序包)
In the directory where you're executing the test script, ensure that there is no Text/Pandoc
folder (or equivalent, depending on the package causing the problem
使用 runghc -v
运行测试脚本以检查其是否搜索正确的目录
Run your test script with runghc -v
to check if it searches the proper directory
ghc-pkg list
列出已安装的软件包,并且没有软件包损坏(使用 ghc-pkg check
进行检查)
ghc-pkg list
lists your package as installed, and no packages are broken (use ghc-pkg check
to check)
我通过重命名〜/.cabal
和〜/.ghc
解决了我的问题.请注意,我这样做时缺少 proper 解决方案,我认为您应该只在万不得已时才这样做.
I solved my problem by renaming ~/.cabal
and ~/.ghc
. Note that I did this lacking a proper solution, I think you should only do this as a last resort.