Kevin Meredith
Kevin Meredith

Reputation: 41909

Adding Dependency - Parse Error

After creating a new project:

$cd myproject
$stack new workbench
$cd workbench/
$stack setup

I attempted to add this ZeroMQ library by updating my workbench.cabal:

$cat workbench.cabal 
name:                workbench

...

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  build-depends:       base >= 4.7 && < 5    # my note: line 19
                       zeromq4-haskell
  default-language:    Haskell2010

But, I get the following when running stack clean:

$stack clean
Unable to parse cabal file .../workbench/workbench.cabal: NoParse "build-depends" 19

What am I doing wrong?

Upvotes: 0

Views: 261

Answers (1)

Zeta
Zeta

Reputation: 105885

Any list in a cabal file must be comma separated, not whitespace separated. The rules concerning .cabal files are listed in the user guide*:

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  build-depends:       base >= 4.7 && < 5,
                       zeromq4-haskell
  default-language:    Haskell2010

* Funny enough, the definition of a x list is missing there.

Upvotes: 2

Related Questions