Cabal错误`未知字段:build-tool-depends`试图遵循仆人教程

时间:2017-10-17 17:30:34

标签: haskell cabal servant

我正在尝试关注the servant tutorial并且我遇到了Cabal错误RecyclerView。这是我的list = list.stream().distinct().collect(Collectors.toList());文件(我是从servant's github repo获得的):

Unknown fields: build-tool-depends

tutorial.cabal能够构建这个吗?这是我得到的输出:

name:                tutorial
version:             0.10
synopsis:            The servant tutorial
homepage:            http://haskell-servant.readthedocs.org/
license:             BSD3
license-file:        LICENSE
author:              Servant Contributors
maintainer:          haskell-servant-maintainers@googlegroups.com
build-type:          Simple
cabal-version:       >=1.10

library
  exposed-modules:     Server
  build-depends:       base == 4.*
                     , base-compat
                     , text
                     , aeson
                     , aeson-compat
                     , blaze-html
                     , directory
                     , blaze-markup
                     , containers
                     , servant == 0.11.*
                     , servant-server == 0.11.*
                     , servant-client == 0.11.*
                     , servant-docs == 0.11.*
                     , servant-js >= 0.9 && <0.10
                     , warp
                     , http-api-data
                     , http-media
                     , lucid
                     , time
                     , string-conversions
                     , bytestring
                     , attoparsec
                     , mtl
                     , random
                     , js-jquery
                     , wai
                     , http-types
                     , transformers
                     , markdown-unlit >= 0.4
                     , http-client
  default-language:    Haskell2010
  ghc-options:         -Wall -pgmL markdown-unlit
  build-tool-depends: markdown-unlit:markdown-unlit

test-suite spec
  type: exitcode-stdio-1.0
  ghc-options: -Wall
  default-language: Haskell2010
  hs-source-dirs: test
  main-is: Spec.hs
  other-modules: JavascriptSpec
  build-depends: base == 4.*
               , tutorial
               , hspec
               , hspec-wai
               , string-conversions

cabal build给出:

➜  servant cabal build
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Warning: tutorial.cabal: Unknown fields: build-tool-depends (line 46)
Fields allowed in this section:
...

我不认为我的cabal --version文件对此错误很重要,但这只是以防万一:

cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library

非常欢迎任何帮助!

1 个答案:

答案 0 :(得分:3)

build-tool-depends是cabal 2.0的新领域。见What's new in Cabal/cabal-install 2.0

  

build-tool-depends字段,替换build-tools并具有更好的语义定义(#3708#1541)。 cabal-install现在将安装所需的构建工具并自动将它们添加到PATH。