我是一名Windows用户,最近使用了最新的堆栈(1.6.3)和最新的GHC(8.2.2)。在最新的GHC中,似乎有可能出现带有错误消息的颜色输出。颜色是通过ANSI转义序列产生的,windows无法理解,因此它只是在真实文本之间显示一堆垃圾文本。
[1 of 2] Compiling IOSystem.Haskeline ( app\IOSystem\Haskeline.hs, .stack-work\dist\5c8418a7\build\galbreak\galbreak-tmp\IOSystem\Haskeline.o )
â[;1mapp\IOSystem\Haskeline.hs:28:13: â[;1mâ[31merror:â[0mâ[0mâ[;1mâ[0mâ[0mâ[;1m
* Couldn't match type `[Char]' with `Text'
Expected type: InputT m (LineResult Text)
Actual type: InputT m (Either LineFailure String)
* In a stmt of a 'do' block: pure $ Right line
In the expression:
do modifyHistory $ addHistoryUnlessConsecutiveDupe line
pure $ Right line
In a case alternative:
Just line
-> do modifyHistory $ addHistoryUnlessConsecutiveDupe line
pure $ Right lineâ[0mâ[0m
â[;1mâ[34m |â[0mâ[0m
â[;1mâ[34m28 |â[0mâ[0m â[;1mâ[31mpure $ Right lineâ[0mâ[0m
â[;1mâ[34m |â[0mâ[0mâ[;1mâ[31m ^^^^^^^^^^^^^^^^^â[0mâ[0m
â[0mâ[0mâ[0m
我试着把
ghc-options: -fdiagnostics-color=never
在我的项目的库和可执行部分。阴谋集团的文件,但似乎没有任何效果。我用详细的输出重新运行了这个堆栈,它似乎正在使用自己的“-fddiagnostics color=always”命令
之后
我指定的ghc选项。
我只是需要stack
不
这样做吧。
stack -v --cabal-verbose build
(省略了大量文本)
2018-01-14 18:54:24.009085:[信息]“C:\Users\Daniel\AppData\Local\Programs\stack\x86\u 64-windows\ghc-8.2.2\bin\ghc.EXE”“--make”“-no link”“-fbuilding cabal package”“-O”“-static”“-outputdir”“。堆栈工作\dist\5c8418a7\build\galbreak\galbreak tmp”“-odir”“。堆栈工作\dist\5c8418a7\build\galbreak tmp”“-hidir”“。堆栈工作\dist\5c8418a7\build\galbreak\galbreak tmp“”-stubdir”“.stack-work\dist\5c8418a7\build\galbreak\galbreak tmp”“-i”“-i.stack-work\dist\5c8418a7\build\galbreak tmp”“-iapp”“-i.stack-work\dist\5c8418a7\build\global autogen”“-i.stack-work\dist\5c8418a7\build\galbreak\autogen”“-i.stack-work\dist\5c8418a7\build\global autogen”“-i.stack-work\dist\5c8418a7\build\global autogen”“。”-i.stack-work\dist\5c8418a7\build\galbreak\galbreak tmp““-IC:\Users\Daniel\AppData\Local\Programs\stack\x86\u 64-windows\msys2-20150512\mingw64\include”“-optP include”“-optP.stack work\dist\5c8418a7\build\galbreak\autogen\cabal\u macros.h”“-hide all packages”“-Wmissing home modules”“-no user package db”“-package db”“C:\sr\snapshots\13cecb13\pkgdb”“-package db”“D:\dev\galaxy break.stack work\install\ccbce92a\pkgdb”“-package db”“.stack work\dist\5c8418a7\package.conf.inplace”“-package id”“base-4.10.1.0”“-package id”“text-1.2.2.2-9VTsh6V7U7hpagw2HDvpZ”“-package id”“haskeline-0.7.4.2-dgujcozamc2ddce2akqr0”“-XHaskell2010”“IOSystem.haskeline”“app\Main.hs”“-W”“-threaded”“-rtsopts”“-rtsopts=-N”“-O2”“-fdiagnostics color=never”“-ddump”hi“”-转储到文件“”-FDDiagnostics颜色=始终”