[英]stack.yaml not pulling in dependency from github
Here's the stack.yaml stanza这是 stack.yaml 节
packages:包:
- location:
git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
extra-dep: true
I add the package to cabal file我将包添加到 cabal 文件中
get error when I try to build当我尝试构建时出错
While constructing the BuildPlan the following exceptions were encountered:
-- While attempting to add dependency,
Could not find package lsh in known packages
What am I doing wrong?我究竟做错了什么?
Current project found here当前项目在这里找到
https://github.com/TwitterFriends/twitter-friend-server https://github.com/TwitterFriends/twitter-friend-server
The problem is syntax.问题是语法。 You added some extra spaces before
extra-dep
.您在
extra-dep
之前添加了一些额外的空格。 Place this in stack.yaml
.把它放在
stack.yaml
。 With this, your project builds on my machine.有了这个,你的项目就建立在我的机器上。
- location:
git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
extra-dep: true
UPDATE: (17 Dec 2017)更新: (2017 年 12 月 17 日)
Since stack-1.6.1
syntax of adding github dependency is changed.由于添加 github 依赖项的
stack-1.6.1
语法已更改。 You need to add your github dependency into extra-deps
field.您需要将您的 github 依赖项添加到
extra-deps
字段中。 Something like this:像这样的东西:
resolver: lts-9.17
packages: [.]
extra-deps:
- fmt-0.5.0.0
- git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
UPDATE: (5 Dec 2019)更新: (2019 年 12 月 5 日)
In stack-2.1.3
you can specify GitHub dependencies in extra-deps
with even shorter syntax:在
stack-2.1.3
您可以使用更短的语法在extra-deps
指定 GitHub 依赖项:
extra-deps:
- github: TwitterFriends/lsh
commit: 57d57f4209e56f526c0eca023907015935c26071
It looks like the problem you're facing is due to a syntax error in the lines in your stack.yaml
file directly preceding those you posted in the question.看起来您面临的问题是由于您的
stack.yaml
文件中的行中的语法错误直接位于您在问题中发布的行之前。
When I visited your repo and checked out the whole stack.yaml
file, I saw this:当我访问你的 repo 并查看整个
stack.yaml
文件时,我看到了这个:
resolver: lts-8.13
# User packages to be built.
# Various formats can be used as shown in the example below.
#
packages:
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
- location:
git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
extra-dep: true
This packages:
line doesn't look right, especially given that later in the file you have:这个
packages:
行看起来不对,特别是考虑到在文件的后面你有:
packages:
- '.'
So my best guess would be that the stack.yaml
file isn't getting parsed correctly, so it can't find the library b/c it doesn't know it should grab it from that location.所以我最好的猜测是
stack.yaml
文件没有被正确解析,所以它找不到库 b/c 它不知道它应该从那个位置获取它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.