[英]Two executables in one cabal file; stack build does not recognize them
[英]Why does Stack not recognize the dependency it just installed?
所以我正在嘗試使用reactive-banana + wxHaskell進行GUI編程。 作為Haskell及其開發工具的新手,我對堆棧感到非常困惑。
所以我嘗試使用stack install wx
,它會提示我安裝wxcore
,這會提示我安裝wxc
和wxdirect
。 stack install wxdirect
,我嘗試運行stack install wxc
,但是看到了:
While constructing the BuildPlan the following exceptions were encountered:
-- Failure when adding dependencies:
wxdirect: needed (>=0.90.1.1), not present in build plan (latest is 0.92.1.0)
needed for package: wxc-0.92.1.1
-- While attempting to add dependency,
Could not find package wxdirect in known packages
Recommended action: try adding the following to your extra-deps in {project root}/stack.yaml
- wxdirect-0.92.1.0
總之,我試圖使用像cabal-install
這樣的stack
。 而且我不確定為什么這是錯的。 如果它是錯的,那么stack
和cabal-install
之間的區別是什么?
堆棧和cabal安裝之間的區別在於堆棧需要一個策划列表(包,版本)。 結果是堆棧將確保那些版本的那些包都將編譯並且開朗。 雖然wxdirect似乎不在策划列表中。 您應該使用stackage提交PR ,這是一件很棒的事情,因為它也會為其他用戶解決這個問題。
您還可以接受最后幾行中給出的建議:
Recommended action: try adding the following to your extra-deps in {project root}/stack.yaml
- wxdirect-0.92.1.0
並修改您的stack.yaml文件。 更改默認值
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps: []
至
extra-deps:
- wxdirect-0.92.1.0
stack現在將嘗試安裝假裝,就好像它(包,版本)已經進入策展列表一樣。
您可能仍會遇到以下問題。
如果你不在一個項目中(並且你想要將一個軟件包堆棧安裝到用戶數據庫,那么cabal安裝會默默地進行),你會遇到這個問題。 這是堆棧和cabal安裝之間的差異之一,但它是一個很好的:cabal安裝包只是將它放入全局數據庫。 在需要更新包之前,這很好。 有了堆棧,你總是在一個項目中。 如果使用stack.yaml在項目外部運行堆棧,堆棧將查詢~/.stack/global/stack.yaml
。 只需堅持那里的額外設計。
確保堆疊升級並在resolver:
使用最新的LTS版本resolver:
stack.yaml
另一個字段。 這可確保您擁有最新的策展。
您可能必須嘗試使用舊版本的wxdirect。 Stackage包有時(但通常不會)落后於每個包的最后一個版本。
您可能遇到了堆棧問題。 我以前見過堆棧錯誤。 您也可以在IRC頻道上詢問。 如果這不起作用,只需要在/ r / haskell上詆毀Edward Kmett,他就會用數學來解決它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.