Haskell: Install pureMD5 package

*爱你&永不变心* 提交于 2021-01-28 02:14:44

问题


I am trying to tell whether two files are likely the same, and found I could make a MD5 hash in Haskell from this StackOverflow thread: Compute MD5 digest of file in Haskell

When I try to install pureMD5, I get an error:

$ cabal install --lib pureMD5
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: base-4.12.0.0/installed-4.1... (user goal)
[__1] trying: ghc-8.6.5/installed-8.6... (user goal)
[__2] next goal: process (user goal)
[__2] rejecting: process-1.6.6.0 (conflict: ghc =>
process==1.6.5.0/installed-1.6...)
[__2] rejecting: process-1.6.5.1, process-1.6.5.0/installed-1.6...,
process-1.6.5.0, process-1.6.4.0, process-1.6.3.0, process-1.6.2.0,
process-1.6.1.0, process-1.6.0.0, process-1.5.0.0, process-1.4.3.0,
process-1.4.2.0, process-1.4.1.0, process-1.4.0.0, process-1.3.0.0,
process-1.2.3.0, process-1.2.2.0, process-1.2.1.0, process-1.2.0.0,
process-1.1.0.2, process-1.1.0.1, process-1.1.0.0, process-1.0.1.5,
process-1.0.1.4, process-1.0.1.3, process-1.0.1.2, process-1.0.1.1,
process-1.0.0.0 (constraint from user target requires ==1.6.6.0)
[__2] fail (backjumping, conflict set: ghc, process)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: process, base, ghc

I am not sure where to go from here, I'm new to Haskell.


回答1:


This is a cabal issue unrelated to pureMD5 (I believe). You can try to install with a different environment as:

cabal new-install --package-env=SomeNewEnv --lib pureMD5

And that should work. But why? well the environment you currently have installed packages into looks something like this:

cat ~/.ghc/x86_64-darwin-8.6.4/environments/default | tail
package-id rts
package-id terminfo-0.4.1.2
package-id transformers-0.5.6.2
package-id deepseq-1.4.4.0
package-id ghc-boot-th-8.6.4
package-id pretty-1.1.3.6
package-id template-haskell-2.14.0.0
package-id directory-1.3.3.0
package-id txt-1.2.4.0-09ee5c37
package-id mtl-2.2.2

So you see it fixes a particular package version - for you it probably keeps process-1.6.5.0. If you remove this file then the attempted install of process-1.6.6.0 will succeed and the install will work without the --package-env.

Again, this is a guess based on the error and what I think your system state is - please do test and report back.

EDIT: For the curious the bug is https://github.com/haskell/cabal/issues/5559



来源:https://stackoverflow.com/questions/58755666/haskell-install-puremd5-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!