用急速,二进制和zip存档逃离阴谋地狱

non*_*ont 5 javascript haskell cabal

我想使用haste-compiler包来执行haskell-to-javascript的事情:

jsnavely@beefy:~/project$ cabal install haste-compiler
Resolving dependencies...
...
Configuring zip-archive-0.2.3...
Building zip-archive-0.2.3...
Preprocessing library zip-archive-0.2.3...
[1 of 1] Compiling Codec.Archive.Zip ( src/Codec/Archive/Zip.hs, dist/build/Codec/Archive/Zip.o )

src/Codec/Archive/Zip.hs:163:27: Not in scope: `decodeOrFail'
Failed to install zip-archive-0.2.3
cabal: Error: some packages failed to install:
haste-compiler-0.3 depends on zip-archive-0.2.3 which failed to install.
zip-archive-0.2.3 failed during the building phase. The exception was:
ExitFailure 1
Run Code Online (Sandbox Code Playgroud)

我注意到有一个更新版本的zip-archive将二进制版本提升到> = 0.7,它提供了这个decodeOrFail功能.因此,我尝试检查haste-compiler repo并将zip-archive版本提交到新的zip-archive 0.2.3.2.但这没有帮助:

jsnavely@beefy:~/project/haste-compiler$ cabal install
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: haste-compiler-0.3 (user goal)
trying: zip-archive-0.2.3.2/installed-208... (dependency of
haste-compiler-0.3)
trying: ghc-7.6.3/installed-0d1... (dependency of haste-compiler-0.3)
next goal: bin-package-db (dependency of ghc-7.6.3/installed-0d1...)
rejecting: bin-package-db-0.0.0.0/installed-837... (conflict: zip-archive =>
binary==0.7.1.0/installed-961..., bin-package-db =>
binary==0.5.1.1/installed-5b8...)
Dependency tree exhaustively searched.
Run Code Online (Sandbox Code Playgroud)

我还尝试手动安装zip-archive和binary,并在沙盒中完成所有这些操作.我不知道该怎么做 - 我真的想用良好类型的haskelly善良替换我所有的javascript.我在我的macbookpro和我的linux机器上遇到同样的问题,两者都运行最新的haskell-platform,ghc版本7.6.3

ick*_*fay 8

你的依赖树看起来像这样:

                      ??????????????????????
            ??????????? haste?compiler?0.3 ?
            ? depends ??????????????????????
            V                           ?
      ?????????????                     ? depends
      ? ghc?7.6.3 ?                     ?
      ?????????????                     V                   
            ? depends                ???????????????????????
            V                        ? zip?archive?0.2.3.2 ?
??????????????????????????           ???????????????????????
? bin?package?db?0.0.0.0 ?                       ?
??????????????????????????                       ? depends
            ? depends                            ?
            V                                    V
    ??????????????????  conflicts with  ??????????????????
    ? binary?0.5.1.1 ?<????????????????>? binary?0.7.1.0 ?
    ??????????????????                  ??????????????????
Run Code Online (Sandbox Code Playgroud)

由于您可能无法重新安装GHC,因此它及其下方的所有内容都为我们"固定",我们将不得不尝试更改zip-archive-0.2.3.2binary-0.7.1.0.让我们看一下约束haste-compiler-0.3:

zip-archive
Run Code Online (Sandbox Code Playgroud)

所以它根本没有指定版本.任何会做的.如果我们查看以前的版本zip-archive,我们会看到版本0.2.2.1是最早的版本,它binarybinary-0.5.1.1基于Hackage构建的已安装版本兼容.所以这是你应该如何解决它:

  1. 取消注册zip-archive-0.2.3.2并按此binary-0.7.1.0顺序:

    % ghc-pkg unregister zip-archive-0.2.3.2
    % ghc-pkg unregister binary-0.7.1.0
    
    Run Code Online (Sandbox Code Playgroud)
  2. 从GHC库目录中删除这两个包.这取决于你的安装不同而不同,但在看看~/.ghc,~/.cabal~/Library/Haskell一个lib目录(可能的子目录或两个),看看是否能找到包在里面的某个地方.

  3. haste-compiler-0.3使用zip-archive版本的约束安装:

    % cabal install --constraint='zip-archive==0.2.2.1' haste-compiler==0.3
    
    Run Code Online (Sandbox Code Playgroud)

这应该有效,但我自己没有尝试过,所以它可能会出错.