【发布时间】:2016-08-06 15:29:45
【问题描述】:
我刚刚安装了一个新的 Haskell 版本:HaskellPlatform-8.0.1-minimal-x86_64-setup-a, 我需要包 MissingH,它需要包网络。 但是 cabal 安装网络会产生:
$ cabal install network
Resolving dependencies...
cabal: Entering directory 'C:\cygwin64\tmp\cabal-tmp-6136\network-2.6.2.1'
Configuring network-2.6.2.1...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for gcc... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe
checking whether the C compiler works... no
configure: error: in `/tmp/cabal-tmp-6136/network-2.6.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
cabal: Leaving directory 'C:\cygwin64\tmp\cabal-tmp-6136\network-2.6.2.1'
Failed to install network-2.6.2.1
cabal.exe: Error: some packages failed to install:
network-2.6.2.1 failed during the configure step. The exception was:
ExitFailure 77
首先,我尝试以管理员身份启动 Cygwin 命令窗口,但这并没有解决问题。 然后,我关注了stack cannot build network - where's config.log?
虽然使用堆栈安装会成功,但 虽然我必须运行堆栈设置
$ stack build
Compiler version mismatched, found ghc-8.0.1 (x86_64), but expected minor version match with ghc-7.10.3 (x86_64) (based on resolver setting in C:\tmp\network-2.6.2.1\stack.yaml).
Try running "stack setup" to install the correct GHC into C:\Users\<username>\AppData\Local\Programs\stack\x86_64-windows\
在堆栈设置、堆栈构建之后,我得到:
$ stack test
network-2.6.2.1: test (suite: regression)
testGetAddrInfo: [OK]
Test Cases Total
Passed 1 1
Failed 0 0
Total 1 1
network-2.6.2.1: test (suite: simple)
Basic socket operations:
testSend: [OK]
testSendAll: [OK]
testSendTo: [OK]
testSendAllTo: [OK]
testSendMany: [OK]
testSendManyTo: [OK]
testRecv: [OK]
testOverFlowRecv: [OK]
testRecvFrom: [OK]
testOverFlowRecvFrom: [OK]
testUserTimeout: [OK]
Test Cases Total
Passed 11 11
Failed 0 0
Total 11 11
但我仍然无法继续使用 MissingH。其实还是在尝试安装网络!
$ cabal install MissingH
Resolving dependencies...
cabal: Entering directory 'C:\cygwin64\tmp\cabal-tmp-5596\network-2.6.2.1'
Configuring network-2.6.2.1...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for gcc... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe
checking whether the C compiler works... no
configure: error: in `/tmp/cabal-tmp-5596/network-2.6.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
cabal: Leaving directory 'C:\cygwin64\tmp\cabal-tmp-5596\network-2.6.2.1'
Failed to install network-2.6.2.1
我也尝试过:http://neilmitchell.blogspot.nl/2010/12/installing-haskell-network-library-on.html,它在 GHC 6.12.3 和 7.0.1 上进行了测试(而不是在新的 8.0.1 版本上)。 不幸的是,我得到了错误:
getEnv: invalid argument (The operation completed successfully.)
为了完整起见,我的阴谋集团版本:
$ cabal -V
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library
安装网络和 MissingH 缺少什么?
【问题讨论】:
-
stack 将组件安装到 ~/.stack/snapshots/... 这不是 cabal 寻找东西的地方。也许您最好为您的工作创建一个 .cabal 文件并使用堆栈来构建它。教程可用here
标签: haskell networking