代码之家  ›  专栏  ›  技术社区  ›  Thomas Cook

哈斯克尔依赖地狱

  •  1
  • Thomas Cook  · 技术社区  · 7 年前

    我试图在Haskell项目中包含一个库的特定版本。这个库是bed and breakfast(用于martix操作),但是我需要特定的版本0.4.3,它修复了乘法实现的一个bug。

    所以,我的堆栈.yaml看起来像这样:

    flags: {}
    extra-package-dbs: []
    packages:
    - .
    extra-deps:
    - bed-and-breakfast-0.4
    - base-4.6.0.1
    resolver: lts-12.8
    

    但我在构建时遇到了一个错误:

    Error: While constructing the build plan, the following exceptions were encountered:
    
    In the dependencies for bed-and-breakfast-0.4:
        base-4.11.1.0 from stack configuration does not match >=4.5 && <4.7  (latest matching version
                      is 4.6.0.1)
    needed due to realworldhaskell-0.1.0.0 -> bed-and-breakfast-0.4
    
    Some different approaches to resolving this:
    
    
      * Set 'allow-newer: true' to ignore all version constraints and build anyway.
    
      * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some
        working build configuration. This can be convenient when dealing with many complicated
        constraint errors, but results may be unpredictable.
    
      * Recommended action: try adding the following to your extra-deps
        in C:\Users\info\Desktop\Projects\haskell\stack.yaml:
    
    - base-4.6.0.1
    

    我做了建议的行动,但没有解决任何问题。我试过使用不同的解析器,看看这是否是我的GHCi版本的一个问题,但没有任何效果。解释这样的错误消息的最佳方法是什么?我应该如何继续?

    编辑:

    如果我删除-base.4.6.0.1并添加allow newer:true,我会得到:

    WARNING: Ignoring out of range dependency (allow-newer enabled): base-4.11.1.0. bed-and-breakfast requires: >=4.5 && <4.7
    bed-and-breakfast-0.4: configure
    Progress 1/2
    
    --  While building custom Setup.hs for package bed-and-breakfast-0.4 using:
          C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.2.0.1_ghc-8.4.3.exe --builddir=.stack-work\dist\7d103d30 configure --with-ghc=C:\Users\info\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.3\bin\ghc.EXE --with-g
    hc-pkg=C:\Users\info\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.3\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\76fd1958\pkgdb --package-db=C:\Users\info\Desktop\Projects\haskell\
    .stack-work\install\8c390635\pkgdb --libdir=C:\Users\info\Desktop\Projects\haskell\.stack-work\install\8c390635\lib --bindir=C:\Users\info\Desktop\Projects\haskell\.stack-work\install\8c390635\bin --datadir=C:\Users\info\Desktop\Proj
    ects\haskell\.stack-work\install\8c390635\share --libexecdir=C:\Users\info\Desktop\Projects\haskell\.stack-work\install\8c390635\libexec --sysconfdir=C:\Users\info\Desktop\Projects\haskell\.stack-work\install\8c390635\etc --docdir=C:
    \Users\info\Desktop\Projects\haskell\.stack-work\install\8c390635\doc\bed-and-breakfast-0.4 --htmldir=C:\Users\info\Desktop\Projects\haskell\.stack-work\install\8c390635\doc\bed-and-breakfast-0.4 --haddockdir=C:\Users\info\Desktop\Pr
    ojects\haskell\.stack-work\install\8c390635\doc\bed-and-breakfast-0.4 --dependency=array=array-0.5.2.0 --dependency=base=base-4.11.1.0 --dependency=binary=binary-0.8.5.1 --dependency=deepseq=deepseq-1.4.3.0 --dependency=template-hask
    ell=template-haskell-2.13.0.0 --extra-include-dirs=C:\Users\info\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\info\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\min
    
    gw64\bin --extra-lib-dirs=C:\Users\info\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
        Process exited with code: ExitFailure 1
        Logs have been written to: C:\Users\info\Desktop\Projects\haskell\.stack-work\logs\bed-and-breakfast-0.4.log
    
        Configuring bed-and-breakfast-0.4...
        Cabal-simple_Z6RU0evB_2.2.0.1_ghc-8.4.3.exe: The package has an impossible
        version range for a dependency on an internal library: bed-and-breakfast
        ==0.3.2. This version range does not include the current package, and must be
        removed as the current package's library will always be used.
    

    编辑2:

    https://wiki.haskell.org/Base_package )所以我需要一个与GHCi版本匹配的解析器。在哪里可以找到解析程序的版本?

    1 回复  |  直到 7 年前
        1
  •  6
  •   lehins Michael Shigorin    7 年前

    以下是对最新可用的 bed-and-breakfast base (>=4.5 && <4.7) ,这意味着它甚至可能无法使用高于7.6的GHC版本进行编译。考虑到在GHC7.8之前甚至没有LTS快照,您对这个包就不太走运了。

    换言之,该软件包已过时,您的选择是:

    • 提交一个问题,希望维护人员能对此做些什么
    • 使用不同的包