haskell - stack.yaml 没有从 github 中提取依赖项

标签 haskell haskell-stack

这是 stack.yaml 节

包:

- location:
   git: https://github.com/TwitterFriends/lsh.git
   commit: 57d57f4209e56f526c0eca023907015935c26071
   extra-dep: true

我将包添加到 cabal 文件

尝试构建时出现错误

While constructing the BuildPlan the following exceptions were encountered:

--  While attempting to add dependency,
    Could not find package lsh in known packages

我做错了什么?

此处找到当前项目

https://github.com/TwitterFriends/twitter-friend-server

最佳答案

问题是语法。您在 extra-dep 之前添加了一些额外的空格。将其放入 stack.yaml 中。这样,您的项目就可以在我的机器上构建了。

- location:
    git: https://github.com/TwitterFriends/lsh.git
    commit: 57d57f4209e56f526c0eca023907015935c26071
  extra-dep: true

更新:(2017 年 12 月 17 日)

stack-1.6.1 添加 github 依赖项的语法已更改。您需要将 github 依赖项添加到 extra-deps 字段中。像这样的事情:

resolver: lts-9.17
packages: [.]

extra-deps:
- fmt-0.5.0.0
- git: https://github.com/TwitterFriends/lsh.git
  commit: 57d57f4209e56f526c0eca023907015935c26071

更新:(2019 年 12 月 5 日)

stack-2.1.3 中,您可以使用更短的语法在 extra-deps 中指定 GitHub 依赖项:

extra-deps:
- github: TwitterFriends/lsh
  commit: 57d57f4209e56f526c0eca023907015935c26071

关于haskell - stack.yaml 没有从 github 中提取依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43789271/

相关文章:

haskell - 将 HSpec 与堆栈结合使用

haskell - 如何使用 Stack/Cabal 构建早期部分的程序输出作为同一构建后续部分的源?

haskell - 红黑树 : Kahrs version

list - Haskell 集合理解

windows - Haskell 用户界面框架?

haskell - 当用作多种类型的值时,如何处理这个多态值?

haskell - 如何在不编译和链接整个项目的情况下加载 `stack ghci`?

Haskell 从对列表到列表对

algorithm - 为什么我的 Haskell 代码似乎没有并行运行

docker - 为什么COPY指令在我的Docker构建中导致缓存未命中