我有mylib库包和myapp应用程序 . 我想在mylib中使用Cardinality包,它只能作为tarball使用 . 所以,我添加到mylib stack.yaml:

packages:
  ...
  - location: https://hackage.haskell.org/package/Cardinality-0.2/Cardinality-0.2.tar.gz
    extra-dep: true

然后我添加到mylib的cabal文件:

build-depends: ...
               , Cardinality

它是可编辑的 . 现在我正在尝试构建依赖于mylib的myapp工具:

packages:
  ...
  - '../mylib'

但我得到错误:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for mylib:
    Cardinality must match -any, but the stack configuration has no specified version (latest matching version is 0.2)
needed since mylib is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps in /home/XXXX/prj/myapp/stack.yaml:

- Cardinality-0.2

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.

那么,如何以正确的方式将基数tarball添加到mylib包中?!