使用不在Hackage上的软件包

问题描述 投票:1回答:1

我正在尝试使用EuterpeaLite(https://github.com/Euterpea/EuterpeaLite),但不在Hackage上。

我像import EuterpeaLite as EL这样导入它,然后像这样将其添加到我的集团文件中:

build-depends:
base >=4.7 && <5
, postgresql-simple
, EuterpeaLite

但是当我运行stack buildstack ghci时,出现此错误:


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

In the dependencies for engine-0.1.0.0:

EuterpeaLite needed, but the stack configuration has no specified version (no package with that name found, perhaps there

is a typo in a package's build-depends or an omission from the stack.yaml packages list?)

needed since engine is a build target.

Some different approaches to resolving this:

Plan construction failed.

非行李包裹是否有特殊流程?

haskell haskell-stack
1个回答
1
投票

我使用了以下步骤。

  1. 创建一个新的堆栈项目stack new myproject --resolver=14.27。我需要指定一个较旧的解析器,因为EuterpeaLite无法使用lts-15.3
  2. 构建
  3. myproject目录中,将以下几行添加到stack.yaml

    extra-deps:
    - git: https://github.com/Euterpea/EuterpeaLite.git
      commit: 5fe2d129bd3087dd78c0feaf4d35fc03ffd36215
    
  4. 也在myproject目录中,我在package.yaml中添加了以下依赖项:

    dependencies:
    - base >= 4.7 && < 5
    - EuterpeaLite           # <- added this line
    
  5. 运行stack build目录中的myproject

如上所述,您可以更改package.yaml文件,而不用使用.cabal。>

© www.soinside.com 2019 - 2024. All rights reserved.