2017-05-04 88 views
1

這裏的stack.yaml節stack.yaml不依賴從GitHub

包:

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

我添加了包時我嘗試建立

到小集團文件

得到錯誤

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

回答

2

發現的問題是語法。您在extra-dep之前添加了一些額外的空格。把它放在stack.yaml。有了這個,你的項目建立在我的機器上。

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

UPDATE:(二○一七年十二月一十七日)

由於添加的github依賴性的語法stack-1.6.1被改變。您需要將您的github依賴項添加到extra-deps字段中。事情是這樣的:

resolver: lts-9.17 
packages: [.] 

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

lsh包被註釋掉.cabal文件。我刪除了評論,並面臨同樣的問題。嘗試做一個混帳拉看到變化。 –

+0

現在我不知道這裏有什麼問題。這對我來說是個謎。但我注意到你有兩個'package'元素。嘗試刪除這兩個'軟件包'並且只添加這個:http://lpaste.net/6027187186263130112它現在爲我找到'lsh'軟件包。另外,不要忘記之前使用「stack clean」,有時可能會有所幫助。 – Shersh

1

它看起來像你面臨的問題是由於線路語法錯誤在你stack.yaml文件直接前面那些你在問題中公佈。

當我訪問了您的回購協議,並簽出了整個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 

packages:行不看的權利,特別是考慮到在文件後面你:

packages: 
- '.' 

所以我最好的猜測是stack.yaml文件沒有得到正確的解析,所以它不能找到它不知道它應該從該位置抓住它的庫b/c。