Haskell 哈斯克尔依赖地狱

Haskell 哈斯克尔依赖地狱,haskell,haskell-stack,Haskell,Haskell Stack,我试图在Haskell项目中包含库的特定版本。该库是基本的(用于martix操作),但我需要特定的版本0.4.3,该版本修复了乘法实现中的一个错误 因此,我的stack.yaml如下所示: flags: {} extra-package-dbs: [] packages: - . extra-deps: - bed-and-breakfast-0.4 - base-4.6.0.1 resolver: lts-12.8 但我在构建时遇到了这个错误: Error: While constructi

我试图在Haskell项目中包含库的特定版本。该库是基本的(用于martix操作),但我需要特定的版本0.4.3,该版本修复了乘法实现中的一个错误

因此,我的stack.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
错误:构造生成计划时遇到以下异常:
在床和早餐的依赖项-0.4中:
堆栈配置中的base-4.11.1.0不匹配>=4.5&&bed-and-Breakth-0.4
解决此问题的一些不同方法:
*设置“allow newer:true”忽略所有版本约束并无论如何生成。
*考虑尝试“堆栈求解器”,它使用阴谋集团安装解决方案试图找到一些
工作构建配置。这在处理许多复杂问题时非常方便
约束错误,但结果可能不可预测。
*建议的操作:尝试将以下内容添加到您的额外DEP中
在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.

警告:忽略超出范围的依赖项(启用允许更新):base-4.11.1.0。住宿和早餐要求:>=4.5&&这是对最新可用的
住宿和早餐
套餐的限制:
base(>=4.5&&您无法更改
base
版本,它与ghc连接,因此请尝试从额外的DEP中删除
-base-4.6.0.1
,并设置
允许更新:true
。我认为您需要使用另一个快照(解析程序
lts-12.8
可能不兼容)是的,我试着将我的解析器设置为早期版本,但这就像一个猜谜游戏。有没有什么合乎逻辑的方法可以让我找到我需要的解析器?嗨!我是《床与早餐》
的作者,我刚刚发布了0.5,它应该可以解决这些问题。很好的一个Scrawy-我将在本周末查看它!对,这实际上是一个可能的解决方案我得到的结论是:我听说HMatrix是一个很好的替代品,但是当我把它作为一个依赖项包含进来时,构建失败告诉我缺少OpenBLAS(经过一些挖掘之后,我似乎需要安装mingw并设置大量的C依赖项……有没有更简单的方法来设置所有这些而不必构建C libs等?是的,切换到Linux;)开玩笑。
HMatrix
是OpenBLAS的包装器,因此如果您想使用该软件包,就没有办法绕过它。根据您需要的操作,还有其他数组操作库可能适合您。我是
massiv
软件包的作者,但它还没有包含很多代数操作,但它是是纯粹的Haskell,所以需要外部依赖。事实上,正是出于这个原因,我开始切换到linux;windows是一个非常烦人的工作环境……但是,vidya games xD,我将看看你的massiv软件包(lol…),它是开源的吗(即,如果我用纯Haskell滚动我自己的矩阵操作,你可能会考虑通过PR合并它们,如果它们匹配你的包主题?)是的,它是开源的。你可以在hackage上找到它,在这里github.com/lehins/massiv我很乐意接受PR,但在做这项工作之前,可能值得为你可能想要添加的东西打开一个问题。@ThomasCook注意,即使在windows上,你也可以经常使用pacman(
stack exec pacman
)获取必要的依赖关系。不确定OpenBLAS是否可以通过该功能使用,但值得一试。