Nix Cabal 未找到依赖关系

Nix Cabal Not Finding Dependencies

尝试在 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

我在使用 out --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 上运行。如果你能解决这个问题,请告诉我。我想我只是配置有误。

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