神秘的阴谋集团安装问题
全新安装“Haskell Platform”。 (OS X Snow-Leopard & Platform 2010.1.0.1),这样做会导致简单的序列导致非常奇怪的 cabal install
行为:
$ cabal install time
$ cabal install random
$ ghc-pkg list random
/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.1/package.conf.d
random-1.0.0.2
/Users/yairc/.ghc/i386-darwin-6.12.1/package.conf.d
random-1.0.0.2
random-1.0.0.2
在我的计算机中安装了两次系统。现在每次执行cabal install random
都会重新安装random-1.0.0.2
。
看起来random
依赖于time
,并且cabal想要在有新版本的time
可用后重新安装它?并且因为两个 random-1.0.0.2
阴谋集团感到困惑,并且总是认为它不是最新的,因为它正在查看第一个?
ghc-pkg check
未发现任何错误。
With a clean install of the "Haskell Platform". (OS X Snow-Leopard & Platform 2010.1.0.1), doing this causes simple sequence causes very weird cabal install
behaviour:
$ cabal install time
$ cabal install random
$ ghc-pkg list random
/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.1/package.conf.d
random-1.0.0.2
/Users/yairc/.ghc/i386-darwin-6.12.1/package.conf.d
random-1.0.0.2
random-1.0.0.2
is installed twice in my system. and now doing cabal install random
reinstalls random-1.0.0.2
every time.
Looks like random
depends on time
, and cabal wants to reinstall it after there's a new version of time
available? And because of two random-1.0.0.2
cabal is confused and always thinks it's not up to date because it's looking at the first one?
ghc-pkg check
finds no errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请这样做
输出
,如果没有显示错误,让我们看看编辑的
:我可以使用 GHC 6.12.1 重现您的问题,但不能使用 6.12.2 重现您的问题,使用完全相同版本的 cabal-安装(0.8.0)。我会调查一下。
编辑2:报告为阴谋集团中的错误 -安装。
Please do
and if that shows no errors, let's see the output from
and
Edit: I can reproduce your problem with GHC 6.12.1, but not with 6.12.2, using exactly the same version of cabal-install (0.8.0). I'll look into it.
Edit 2: reported as a bug in cabal-install.
我有两种可能的解决方案,这两种解决方案都有些危险,但应该可以让您正常安装。我很高兴西蒙关注这个,因为这对我来说听起来像是某种错误。为了获得有效的安装,我会首先尝试以下操作:
然后执行 ghc-pkg list random 以查看安装的内容。我猜测(但我不确定)您仍然拥有 /Library/Frameworks 版本(来自平台),但新安装的版本将会消失。如果是这种情况,请继续执行下一步。如果不是,您可能需要彻底重新安装平台。
假设平台随机仍然存在,请执行以下操作:
cd 到其解压到的目录,然后通过将版本更改为 1.0.0.2.1 来编辑 .cabal 文件(添加另一个字段并将其递增 1)。然后从该目录安装 cabal,它应该安装新的随机文件。由于它的版本与平台随机版本不同,因此两者可以安全地共存。
您可以直接从以下位置删除注册文件,而不是执行 ghc-pkg 取消注册
文件名将附加一个哈希值,因此您需要查看目录内容才能实际获取值。只需删除该文件,从那时起 ghc-pkg 和 cabal 就看不到它了。这不会影响平台安装(因此从这个意义上来说它更安全),但仍然有可能对其他已安装的软件包进行软管连接。之后,您可以通过解压并增加上述版本来重新安装随机包。
I have two possible solutions, both of which are somewhat dangerous but should get you a working installation. I'm glad Simon's following this because it sounds like some sort of bug to me. To get a working installation, I would try the following first:
then do ghc-pkg list random to see what's installed. I would guess (but I'm not sure) that you'll still have the /Library/Frameworks version (from the Platform) but the newly-installed version will be gone. If this is the case, proceed to the next step. If it isn't you'll probably need to do a clean reinstall of the platform.
Assuming the platform random is still present, do this:
cd to the directory it's unpacked into, and edit the .cabal file by bumping the version to 1.0.0.2.1 (add another field and increment it by one). Then cabal install from that directory and it should install the new random. Since this has a different version than the platform random, the two can safely co-exist.
Rather than doing the ghc-pkg unregister, you can directly delete the registration file from
the file name will have a hash appended to it, so you'll need to look at the directory contents to actually get the value. Just delete the file and ghc-pkg and cabal shouldn't see it from then on. This won't touch the platform installation (so it's safer in that sense), but the potential is still there to hose other installed packages. After this, you can re-install the random package by unpacking and incrementing the version as above.
我将描述迄今为止对我有用的解决方法。我尝试了很多不同的事情,但我只会在这里描述有效的尝试。
(顺便说一句:我使用的是 Mac OS X 10.6.4,不同系统上的结果可能会有所不同)
/usr/bin
中的符号链接(对于ghc
、ghci
、ghc-pkg
和>runhaskell
) 到我之前的 GHC,它来自 Haskell Platform 2010.1.0.1 安装程序。random
和haskell98
软件包的修补版本。差异仅在于它们的.cabal
文件中random
的版本提升至1.0.0.2.1
,并将其对time
的依赖更改为time == 1.1.*
haskell98
的版本提升至1.0.1.1.1
,仅此而已cabal update
和 < code>cabal Upgrade 查看哪些软件包已过期。我cabal install
那些。我相信这有助于更快地达到稳定状态。 (请注意,syb
的安装失败,cabal install parsec
表示没有什么可做的,而cabal Upgrade
的说法不同。所以我离开了仅这两个包)我通过在阶段之间运行 ghc-pkg check 来验证我的设置是否正确。有时它会中断,因为在具有相同版本号的先前版本上重新安装了软件包,并且需要重新安装依赖于它的软件包。当这种情况发生时,我会再次
cabal install
损坏的软件包。我还使用以下程序来验证我的安装程序不包含两个具有相同版本的软件包:
I
cabal install
edhlint
,yesod< /code>、
haddock
、HDBC-mysql
、hakyll
等软件包,然后我cabal install
了前面的一次又一次地列出,直到我的设置达到“稳定状态”,其中cabal install
不会重新安装任何这些。我验证了我正在编写的程序现在可以编译并运行。现在一切似乎都很好
注意:
这个解决方法也可能在未来的某个时候被打破。我想这可能会在几个月后发生。像
random
这样的核心库将得到更新,然后依赖性问题将再次开始解决。然后我/你将不得不花时间来修复我们的设置。也许那时需要升级到更新的 GHC。但谁知道呢,也许这将是一个较旧的版本,随着 hackage 包的更新以解决依赖相关问题,该版本将变得稳定。作为对您的服务,我会在适当的时候更新这个问题和答案。 (假设其他人也遇到这个问题。到目前为止,我验证了 Simon Marlow 和 Peaker 也面临这个问题)知道你的 Haskell 设置是否损坏的方法(如果其中任何一个为真,则设置已损坏):
ghc-pkg check
表示它已损坏cabal update
然后循环cabal install
我上面编写的软件包列表或另一个列表(最好是一个包含大量依赖项的大列表)。如果您从未达到稳定状态(循环的迭代总是会重新安装某些内容),那么您的设置就会被破坏。 警告:此步骤可能会破坏您当前运行的 Haskell 设置。如果您对 Maso 感到好奇或愿意在设置损坏后修复它(这个过程可能很耗时),请执行此操作我想知道您的设置是否损坏或正常工作。这可以帮助我。例如,如果我们发现 GHC 6.10 设置运行良好,I/U 可以在推荐某人尝试 Haskell 等时向人们推荐这些设置。
我希望这可以帮助其他面临相同或类似问题的人。非常感谢西蒙·马洛和约翰!
I'll describe the work-around that worked so far for me. I've tried many different things but I'll only described here the attempt that worked.
(btw: I'm using Mac OS X 10.6.4 and your results might be different on different systems)
/usr/bin
(forghc
,ghci
,ghc-pkg
, andrunhaskell
) to my previous GHC which was the one from the Haskell Platform 2010.1.0.1 installer.cabal-install
using it'sbootstrap.sh
script.random
andhaskell98
packages. The differences are just in their.cabal
filesrandom
's version up to1.0.0.2.1
and changed it dependency ontime
to betime == 1.1.*
haskell98
's versions up to1.0.1.1.1
and that's itcabal update
andcabal upgrade
to see which packages are out of date. I didcabal install
those. I believe that this helps reach a stable-state faster. (note thatsyb
's install failed and thatcabal install parsec
said there's nothing to do about it whencabal upgrade
said differently. So I left those two packages alone)I validated that my setup is ok by running
ghc-pkg check
between stages. Sometimes it breaks because a package gets reinstalled over a previous version with same version number and packages that depended on it need to be reinstalled. When that happens Icabal install
the broken packages again.I also used the following program to verify that my setup doesn't contain two packages with the same version:
I
cabal install
edhlint
,yesod
,haddock
,HDBC-mysql
,hakyll
and other packages and then Icabal install
ed the previous list again and again until my setup reached a "stable state" in whichcabal install
doesn't reinstall any of those.I verified that my own programs I'm working on now compile and work. All seems to be fine now
Notes:
This work-around will probably break sometime in the future as well. I guess that this will probably happen in a few months. A core library like
random
will get updated and then dependency problems will start to unravel again. Then I'll/you'll have to spend time on getting our setups fixed. Perhaps then it would require upgrading to a newer GHC. But who knows, maybe then it will be an older release that will become stable as hackage packages get updated to solve dependency related problems. As a service to you, I will update this question and answer when the time comes. (Assuming that others are having this problem too. So far I validated that Simon Marlow and Peaker face this problem too)Ways to know that your Haskell setup is broken (if any of these is true then the setup is broken):
ghc-pkg check
says that it is brokencabal update
and then cyclecabal install
ing the list of packages I wrote above, or another list (preferably a big one with lots of dependencies). If you never reach a stable-state (an iteration of the cycle always reinstalls something) then your setup is broken. WARNING: This step may destroy your currently functioning Haskell setup. Do this if you are maso-curious or willing to fix your setup after it breaks (a process which might be time consuming)I would like to know whether your setups are broken or working. This could help me. For example if we find that GHC 6.10 setups are working fine, I/U could recommend those setups to people on the occasion of recommending to someone to try out Haskell etc.
I hope that this helps others facing the same or similar problems. Many thanks to Simon Marlow and John!