2
我使用stack new project yesod-postgres
創建了Yesod應用程序。除了Web應用程序之外,我還想創建另一個使用相同數據庫模型和數據庫連接的程序。如何根據Yesod應用程序構建程序
我在cabal文件中添加了第二個executable
部分(第一個副本),其名稱不同,main-is: myprogram.hs
。我現在可以成功運行stack build && stack exec myprogram
。
的問題是,構建始終以超過1分鐘:
$ stack build
project-0.0.0: unregistering
yesod-persistent-1.4.0.6: configure
yesod-persistent-1.4.0.6: build
yesod-persistent-1.4.0.6: copy/register
yesod-form-1.4.9: configure
yesod-form-1.4.9: build
yesod-form-1.4.9: copy/register
yesod-auth-1.4.15: configure
yesod-auth-1.4.15: build
yesod-auth-1.4.15: copy/register
yesod-1.4.3.1: configure
yesod-1.4.3.1: build
yesod-1.4.3.1: copy/register
classy-prelude-yesod-0.12.8: configure
classy-prelude-yesod-0.12.8: build
classy-prelude-yesod-0.12.8: copy/register
project-0.0.0: build
Preprocessing library project-0.0.0...
In-place registering project-0.0.0...
Preprocessing executable 'myprogram' for project-0.0.0...
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/myprogram/myprogram ...
Preprocessing executable 'project' for project-0.0.0...
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/project/project ...
project-0.0.0: copy/register
Installing library in
/home/jakob/projects/project/project/.stack-work/install/x86_64-linux/lts-6.27/7.10.3/lib/x86_6
4-linux-ghc-7.10.3/project-0.0.0-1qruVQVcU0k2yXxF1Z1w7r
Installing executable(s) in
/home/jakob/projects/project/project/.stack-work/install/x86_64-linux/lts-6.27/7.10.3/bin
Registering project-0.0.0...
Completed 6 action(s).
我如何可以加快構建過程?我怎樣才能防止堆棧每次重建yesod依賴關係?
作爲[Stack issue 2876]提交(https://github.com/commercialhaskell/stack/issues/2876)。 –
工作正常!感謝您和+1提交錯誤。 – schoettl