`stack build`需要很长时间来传递错误消息。我怎样才能改进它?

时间:2015-10-22 20:45:30

标签: haskell haskell-stack

我正在使用堆栈来组织我的Haskell项目,如下所示:

.
├── ProjectA
│   ├── Main.hs
│   ├── ProjectA.cabal
│   └── Setup.hs
├── ProjectB
│   ├── Main.hs
│   ├── ProjectB.cabal
│   └── Setup.hs
├── ProjectC
│   ├── Main.hs
│   ├── ProjectC.cabal
│   └── Setup.hs
└── stack.yaml

也就是说,我有很多目录,每个目录都包含一个包,还有一个包含这些目录的堆栈环境。在我的工作流程中,我使用stack build来获取编译错误并指导我的工作。问题是,给我正确的错误消息需要花费太长时间,并且它会重建我编辑的每个文件的每个依赖项。我喜欢以交互方式工作 - 也就是说,我编辑几行代码,编译,重复 - 总是一次只编辑一个文件。这大大减缓了我的工作流程。

在使用stack(使用全局安装)之前,我只会在我正在编辑的文件上运行GHCI,但是that doesn't work anymore。有没有办法加速在我的设置上收到错误消息?

这是stack build --verbose

的输出
2015-10-23 14:58:29.987203: [debug] Checking for project config at: /Users/v/hs/stack.yaml @(stack-0.1.2.0:Stack.Config src/Stack/Config.hs:496:9)
2015-10-23 14:58:29.987438: [debug] Loading project config file stack.yaml @(stack-0.1.2.0:Stack.Config src/Stack/Config.hs:519:13)
2015-10-23 14:58:29.997623: [debug] Run process: ghc --info @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:30.097836: [debug] Run process: ghc --numeric-version @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:30.164305: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal id @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:30.210596: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:30.272135: [debug] Checking resolver: lts-3.7 @(stack-0.1.2.0:Stack.Build.Source src/Stack/Build/Source.hs:86:13)
2015-10-23 14:58:30.609624: [debug] Run process: ghc-pkg --global --no-user-package-db dump --expand-pkgroot @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:30.69387: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ dump --expand-pkgroot @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:30.767327: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ dump --expand-pkgroot @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:31.82109: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:31.867523: [info] Game-0.1.0.0-d9d944cf39a7cec36b48d4a724502fa6: unregistering (missing dependencies: Image) @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:315:17)
2015-10-23 14:58:31.867867: [debug] Run process: ghc-pkg --no-user-package-db --package-db=/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ unregister --user --force Game-0.1.0.0 @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:31.958876: [info] Image-0.1.0.0-6944dffdf3e7e7ee0a9401deccf4f104: unregistering (local file changes) @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:315:17)
2015-10-23 14:58:31.959184: [debug] Run process: ghc-pkg --no-user-package-db --package-db=/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ unregister --user --force Image-0.1.0.0 @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:32.052864: [info] Image-0.1.0.0: build @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)
2015-10-23 14:58:32.053139: [debug] Run process: /Applications/ghc-7.10.2.app/Contents/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ /var/folders/1r/s4q2bscs1xqfzl1913c0wwbm0000gn/T/stack3896/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ build @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:591:13)
2015-10-23 14:58:36.437519: [info] Image-0.1.0.0: install @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)
2015-10-23 14:58:36.437713: [debug] Run process: /Applications/ghc-7.10.2.app/Contents/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ /var/folders/1r/s4q2bscs1xqfzl1913c0wwbm0000gn/T/stack3896/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ install @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:591:13)
2015-10-23 14:58:37.063125: [debug] Run process: ghc-pkg --no-user-package-db --package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ --package-db=/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ field --simple-output Image id @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:37.139879: [info] Game-0.1.0.0: build @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)
2015-10-23 14:58:37.140276: [debug] Run process: /Applications/ghc-7.10.2.app/Contents/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ /var/folders/1r/s4q2bscs1xqfzl1913c0wwbm0000gn/T/stack3896/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ build @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:591:13)
2015-10-23 14:58:38.232964: [info] Game-0.1.0.0: install @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)
2015-10-23 14:58:38.233154: [debug] Run process: /Applications/ghc-7.10.2.app/Contents/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ /var/folders/1r/s4q2bscs1xqfzl1913c0wwbm0000gn/T/stack3896/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ install @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:591:13)
2015-10-23 14:58:38.85603: [debug] Run process: ghc-pkg --no-user-package-db --package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ --package-db=/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ field --simple-output Game id @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:38.931549: [info] Test-0.1.0.0: build @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)
2015-10-23 14:58:38.931772: [debug] Run process: /Applications/ghc-7.10.2.app/Contents/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ /var/folders/1r/s4q2bscs1xqfzl1913c0wwbm0000gn/T/stack3896/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ build @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:591:13)
2015-10-23 14:58:42.550672: [info] Test-0.1.0.0: install @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)
2015-10-23 14:58:42.550859: [debug] Run process: /Applications/ghc-7.10.2.app/Contents/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ /var/folders/1r/s4q2bscs1xqfzl1913c0wwbm0000gn/T/stack3896/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ install @(stack-0.1.2.0:Stack.Build.Execute src/Stack/Build/Execute.hs:591:13)
2015-10-23 14:58:43.308516: [debug] Run process: ghc-pkg --no-user-package-db --package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ --package-db=/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ field --simple-output Test id @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2015-10-23 14:58:43.381165: [debug] Run process: ghc-pkg --no-user-package-db --package-db=/Users/v/.stack/snapshots/x86_64-osx/lts-3.7/7.10.2/pkgdb/ --package-db=/Users/v/hs/.stack-work/install/x86_64-osx/lts-3.7/7.10.2/pkgdb/ field --simple-output Test id @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
Completed all 3 actions.

0 个答案:

没有答案