【问题标题】:Nix Cabal Not Finding DependenciesNix Cabal 没有找到依赖项
【发布时间】:2018-10-22 11:12:30
【问题描述】:

在 nix-os 上尝试 nix 构建:

 cabal --enable-nix install
Resolving dependencies...
Configuring alex-3.2.4...
Configuring happy-1.19.9...
Configuring c2hs-0.28.3...
Building alex-3.2.4...
Building c2hs-0.28.3...
Building happy-1.19.9...
Installed alex-3.2.4
Installed happy-1.19.9
Installed c2hs-0.28.3
Configuring PathFinder-0.1.0.0...
Failed to install PathFinder-0.1.0.0
Build log ( /home/liminal18/.cabal/logs/ghc-7.10.3/PathFinder-0.1.0.0-Ct8hE4tpk2v4C0mK830b0v.log ):
cabal: Entering directory '.'
Configuring PathFinder-0.1.0.0...
cabal: The following package dependencies were requested
--dependency='alex=alex-3.2.4-EcO8GwV5VLDHmJwcir1l4u'
--dependency='c2hs=c2hs-0.28.3-ConONz4xJmFDgUCTAA6Wmq'
--dependency='happy=happy-1.19.9-4PZ32S6SvwZBaSXkci9sAS'
however the given installed package instance does not exist.
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
PathFinder-0.1.0.0-Ct8hE4tpk2v4C0mK830b0v failed during the configure step.
The exception was:
ExitFailure 1

不使用 --enable-nix 也会出现同样的错误

cabal configure
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: PathFinder-0.1.0.0 (user goal)
unknown package: c2hs (dependency of PathFinder-0.1.0.0)
fail (backjumping, conflict set: PathFinder, c2hs)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: PathFinder, c2hsTrying configure
anyway.
Configuring PathFinder-0.1.0.0...
cabal: Encountered missing dependencies:
alex -any, c2hs -any, happy -any

项目的源代码在这里: https://github.com/aljones15/SimplePathFinding

我可以很好地为 c2hs 和其他依赖项进行 cabal 安装,但是我的构建脚本似乎不适用于 nix-os。让我知道你是否能解决这个问题。我想我只是配置有问题。

【问题讨论】:

    标签: haskell cabal nixos


    【解决方案1】:

    在 cabal 文件中,对于您依赖的可执行文件,您应该使用 build-tool-depends 字段而不是 build-depends

    【讨论】:

    • cabal: ./PathFinder.cabal:23: 解析字段“build-tool-depends”失败。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-29
    • 2010-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-29
    相关资源
    最近更新 更多