在构建项目时,我收到了一个神秘的错误
C:\Users\T60\Dropbox\note-build>stack build
note-build-0.1.0.0: build
Preprocessing library note-build-0.1.0.0...
setup-Simple-Cabal-1.22.5.0-ghc-7.10.3.exe: unsatisfied constraints
-- While building package note-build-0.1.0.0 using:
C:\stack_root\setup-exe-cache\i386-windows\setup-Simple-Cabal-1.22.5.0-ghc-7.10.3.exe --builddir=.stack-work\dist\95439361 build lib:note-build exe:note-build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
这似乎是由于将文件路径添加到我的cabal文件的可执行文件部分引起的。我的Main.hs文件使用System.FilePath,并且我的cabal文件中没有该行失败,但添加它会给我这个错误。在尝试使用文件路径模块之前,项目将构建。
executable note-build
hs-source-dirs: app
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends: base
, filepath
, directory
, note-build
default-language: Haskell2010
这个错误意味着什么,我是否将依赖项放在我的cabal文件中的错误位置?
更新:我使用-v标志运行了构建,它显示我心不在焉地将+
替换为++
。
C:\Users\T60\Dropbox\note-build\app\Main.hs:20:31: @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Build.Execute src/Stack\Build\Execute.hs:911:67)
2016-07-07 22:08:24.020516: [warn] No instance for (Num FilePath) arising from a use of `+' @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Build.Execute src/Stack\Build\Execute.hs:911:67)
2016-07-07 22:08:24.051760: [warn] In the first argument of `normalise', namely `(y + "/")' @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Build.Execute src/Stack\Build\Execute.hs:911:67)
2016-07-07 22:08:24.067386: [warn] In the expression: normalise (y + "/") @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Build.Execute src/Stack\Build\Execute.hs:911:67)
2016-07-07 22:08:24.129886: [warn] In an equation for `y_norm': y_norm = normalise (y + "/").
所以修复很容易,但我应该认为这是一个堆栈的潜在问题,我不得不使用详细输出来看看看起来像一个简单的类型错误?