Ger*_*era 5 haskell happstack haskell-stack
我正在尝试使用stack设置happstack-lite应用程序。
我用这些命令初始化了项目:
stack new my-happstack
cd my-happstack
stack setup
Run Code Online (Sandbox Code Playgroud)
我更改了package.yaml,因此它包含:
dependencies:
- base >= 4.7 && < 5
- happstack-lite >= 7.3
Run Code Online (Sandbox Code Playgroud)
然后我多次运行stack build并根据建议更改了项目目录中stack.yaml中的extra-deps(添加了依赖项,例如happstack-server)。
显然,我被要求将已经列出的包添加到extra-deps中,它们具有不同的版本边界和相同的版本(template-haskell-2.11.1.0):
stack.yaml内容:
extra-deps:
- happstack-lite-7.3.6
- happstack-server-7.4.6.4
- Win32-2.2.2.0@sha256:10ed55dd31315f386910c121c1d1d442df83bd2ee92090a753cd65300735a8ca
- network-2.6.3.6@sha256:1ca79d81af02d7acd6032d5e6c9bde4618a8fdcfbe19bd42b49d420183975df0
- template-haskell-2.11.1.0@sha256:f90d6ab73ad35c749e8547ca132e7ab5d32d2f8e7bb2e2ff6d597be26b58e061
- transformers-compat-0.5.1.4@sha256:1b4bfa8589afb1ca0e719129ab261bd90ef0cc3e6c0b9963f94970c082b61250
Run Code Online (Sandbox Code Playgroud)
堆栈构建的输出:
F:\Projects\Haskell\my-happstack>stack build
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for Cabal-2.4.1.0:
Win32-2.2.2.0 from stack configuration does not match >=2.3.0.0 && <2.9 (latest matching
version is 2.8.3.0)
needed due to my-happstack-0.1.0.0 -> Cabal-2.4.1.0
In the dependencies for happstack-server-7.4.6.4:
template-haskell-2.14.0.0 from stack configuration does not match <2.12 (latest matching
version is 2.11.1.0)
needed due to my-happstack-0.1.0.0 -> happstack-server-7.4.6.4
In the dependencies for transformers-base-0.4.5.2:
transformers-compat-0.5.1.4 from stack configuration does not match >=0.6.1 (latest matching
version is 0.6.4)
needed due to my-happstack-0.1.0.0 -> transformers-base-0.4.5.2
Some different approaches to resolving this:
* Set 'allow-newer: true' in C:\sr\config.yaml 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 F:\Projects\Haskell\my-happstack\stack.yaml:
Win32-2.8.3.0@sha256:58fa6f52e8a0d455a74bb19445c177f2cc79a0975cae5fd96e2334bd38a516d4
template-haskell-2.11.1.0@sha256:f90d6ab73ad35c749e8547ca132e7ab5d32d2f8e7bb2e2ff6d597be26b58e061
transformers-compat-0.6.4@sha256:d298cd9d1bb7b05160229e244436bae825b53660865e3d5fd695ea0fafec1e6f
Plan construction failed.
Run Code Online (Sandbox Code Playgroud)
我试过这些步骤:
1)在C:\sr\config.yaml 中设置'allow-newer: true'。在这种情况下,我从依赖包之一中收到有关错误类型使用的错误(如果需要,可以根据请求粘贴错误输出)。
2)运行堆栈求解器。我收到了来自 cabal planner 的错误(根据请求输出错误)。
所以,我希望stack能够像npm那样解决依赖关系——每个包的依赖关系都是独立于其他包的需求来解决的。不过,关于如何解决这个特定问题的任何建议都会有所帮助(包括手动解决依赖关系)。