当我在一个全新的项目上运行
(由于问题更易读性,附加输出已省略。)
这是在Windows 10(x64)上。我有另一台配置和堆栈版本类似的机器,在那台机器上,我没有任何问题。这似乎是一个环境问题,但我无法弄清楚是什么原因。
我正在从Git Bash运行,并且如果我以管理员身份运行它,它就可以工作:
stack ghci
时,它无法加载:$ stack new repro simple
Downloading template "simple" to create project "repro" in repro\ ...
(由于问题更易读性,附加输出已省略。)
$ cd repro/
$ stack ghci
Using main module: 1. Package `repro' component repro:exe:repro with main-is file: C:\Users\mark\Desktop\repro\src\Main.hs
Building all executables for `repro' once. After a successful build of all of them, only specified executables will be rebuilt.
repro> configure (exe)
Configuring repro-0.1.0.0...
repro> initial-build-steps (exe)
Configuring GHCi with the following packages: repro
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
<command line>: user specified .o/.so/.DLL could not be loaded (addDLL: pthread or dependencies not loaded. (Win32 error 5))
Whilst trying to load: (dynamic) pthread
Additional directories searched: C:\\Users\\mark\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20180531\\mingw64\\lib
C:\\Users\\mark\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20180531\\mingw64\\bin
C://Users//mark//AppData//Local//Programs//stack//x86_64-windows//ghc-8.6.5//mingw//bin/
C://Users//mark//AppData//Local//Programs//stack//x86_64-windows//ghc-8.6.5//mingw//bin/../lib/
C://Users//mark//AppData//Local//Programs//stack//x86_64-windows//ghc-8.6.5//mingw//bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/
C:/Users/mark/AppData/Local/Programs/stack/x86_64-windows/ghc-8.6.5/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/
C:/Users/mark/AppData/Local/Programs/stack/x86_64-windows/ghc-8.6.5/mingw/bin/../lib/gcc/
C:/Users/mark/AppData/Local/Programs/stack/x86_64-windows/ghc-8.6.5/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/
C:/Users/mark/AppData/Local/Programs/stack/x86_64-windows/ghc-8.6.5/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../lib/
C:/Users/mark/AppData/Local/Programs/stack/x86_64-windows/ghc-8.6.5/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/
C:/Users/mark/AppData/Local/Programs/stack/x86_64-windows/ghc-8.6.5/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../
C:\Windows\system32
这是在Windows 10(x64)上。我有另一台配置和堆栈版本类似的机器,在那台机器上,我没有任何问题。这似乎是一个环境问题,但我无法弄清楚是什么原因。
我正在从Git Bash运行,并且如果我以管理员身份运行它,它就可以工作:
$ stack ghci
Using main module: 1. Package `repro' component repro:exe:repro with main-is file: C:\Users\mark\Desktop\repro\src\Main.hs
Building all executables for `repro' once. After a successful build of all of them, only specified executables will be rebuilt.
repro> initial-build-steps (exe)
Configuring GHCi with the following packages: repro
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( C:\Users\mark\Desktop\repro\src\Main.hs, interpreted )
Ok, one module loaded.
Loaded GHCi configuration from C:\\Users\\mark\\AppData\\Local\\Temp\\haskell-stack-ghci\\2524149e\\ghci-script
*Main>
我已经在 Windows 上使用 Stack 工具有好几年了,但这是我第一次需要以管理员身份运行它,这真的让我很困扰。可能出了什么问题?我该如何解决?
顺便说一下,这是 Stack 的版本信息:
$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
这是与我在另一台机器上没有出现问题的相同版本。
这里的示例是从运行的Git Bash中复制的,但如果我使用cmd,问题将是相同的。
C:\sr
和%LOCALAPPDATA%\Programs\stack
,以及本地的.stack-work
目录,重新启动,再次安装 Stack;但是没有任何改变。 - Mark Seemann