文件存在时找不到cabal文件

时间:2016-01-15 10:32:43

标签: haskell cabal cabal-install haskell-platform

我有以下目录结构: ls

  Project.Cabal
  LICENSE
  Setup.hs
  cabal.sandbox.config
  dist
  src
     Main.hs
     otherstuff
  tests

运行cabal install --only-denendencies会产生:   cabal:读取本地包时出错。   无法在:。

中找到.cabal文件

正在运行cabal install -v3 --only-dependencies会产生相对较长的输出,我目前选择不完整发布,以避免立即产生压力。错误之前的最后几行是:

The package database already exists:
/Users/abraham/github/hamming_distance/.cabal-sandbox/x86_64-osx-ghc-7.10.2-packages.conf.d
Reading available packages...
Reading installed packages...
("/usr/bin/ghc-pkg",["dump","--package-db=/Users/abraham/github/hamming_distance/.cabal-sandbox/x86_64-osx-ghc-7.10.2-packages.conf.d","-v0"])
("/usr/bin/ghc",["--print-libdir"])
Found no modified add-source deps.
Reading installed packages...
("/usr/bin/ghc-pkg",["dump","--global","-v0"])
("/usr/bin/ghc-pkg",["dump","--package-db=/Users/abraham/github/hamming_distance/.cabal-sandbox/x86_64-osx-ghc-7.10.2-packages.conf.d","-v0"])
("/usr/bin/ghc",["--print-libdir"])
Reading available packages...
cabal: Error reading local package.
Couldn't find .cabal file in: .

同样地,运行cabal build会产生:

Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
cabal: No cabal file found.
Please create a package description file <pkgname>.cabal

While running `cabal build -v3` produces:
..
..
..
The package database already exists:
/Users/abraham/github/hamming_distance/.cabal-sandbox/x86_64-osx-ghc-7.10.2-packages.conf.d
Reading installed packages...
("/usr/bin/ghc-pkg",["dump","--global","-v0"])
("/usr/bin/ghc-pkg",["dump","--package-db=/Users/abraham/github/hamming_distance/.cabal-sandbox/x86_64-osx-ghc-7.10.2-packages.conf.d","-v0"])
("/usr/bin/ghc",["--print-libdir"])
Reading available packages...
cabal: No cabal file found.
Please create a package description file <pkgname>.cabal

发生了什么事?为什么我的阴谋失败了?我该如何解决?

1 个答案:

答案 0 :(得分:3)

错误消息中已有提示:

cabal: No cabal file found.
Please create a package description file <pkgname>.cabal

Cabal only looks for .cabal files,而非.Cabal。将Project.Cabal的扩展名更改为小写的扩展名。