Haskell包版本冲突绊倒了链接器。怎么解决?

时间:2014-08-31 14:00:15

标签: haskell

我正在玩happstack-serveraeson

在我的项目中导入两个模块时,ghc在链接期间抛出错误:

Linking Main ...
duplicate symbol _fps_reverse in:
    /usr/local/Cellar/ghc/7.6.3_3/lib/ghc-7.6.3/bytestring-0.10.0.2/libHSbytestring-0.10.0.2.a(fpstring.o)
    /Users/jan/.cabal/lib/x86_64-osx-ghc-7.6.3/bytestring-0.10.4.0/libHSbytestring-0.10.4.0.a(fpstring.o)
duplicate symbol _fps_intersperse in:
    /usr/local/Cellar/ghc/7.6.3_3/lib/ghc-7.6.3/bytestring-0.10.0.2/libHSbytestring-0.10.0.2.a(fpstring.o)
    /Users/jan/.cabal/lib/x86_64-osx-ghc-7.6.3/bytestring-0.10.4.0/libHSbytestring-0.10.4.0.a(fpstring.o)
duplicate symbol _fps_maximum in:
    /usr/local/Cellar/ghc/7.6.3_3/lib/ghc-7.6.3/bytestring-0.10.0.2/libHSbytestring-0.10.0.2.a(fpstring.o)
    /Users/jan/.cabal/lib/x86_64-osx-ghc-7.6.3/bytestring-0.10.4.0/libHSbytestring-0.10.4.0.a(fpstring.o)

...Some more omitted for brevity...

ld: 11 duplicate symbols for architecture x86_64
collect2: error: ld returned 1 exit status

因此,我的系统上存在两个版本的bytestring。 Happstack刚刚建成,Aeson就在今天。 Happstack的指定字节串依赖性足够宽,可以使用0.10.4.0。但我似乎无法让Happstack使用它。

我已尝试使用cabal install --reinstall happstack-server重新安装happstack,但这并没有帮助。

任何提示如何解决这个问题?

更新: 正如Daniel在评论中所说,我尝试了以下内容:

~/development $ cabal install --reinstall happstack-server --constraint="bytestring == 0.10.4.0" --dry-run
Resolving dependencies...
In order, the following would be installed:
base64-bytestring-1.0.0.1 (reinstall) changes: bytestring-0.10.0.2 -> 0.10.4.0
blaze-builder-0.3.3.2 (new version)
blaze-markup-0.6.1.0 (reinstall) changes: blaze-builder-0.3.1.0 -> 0.3.3.2,
bytestring-0.10.0.2 -> 0.10.4.0, text-0.11.3.1 -> 1.1.1.3
blaze-html-0.7.0.2 (reinstall) changes: blaze-builder-0.3.1.0 -> 0.3.3.2,
bytestring-0.10.0.2 -> 0.10.4.0, text-0.11.3.1 -> 1.1.1.3
parsec-3.1.5 (new version)
network-uri-2.6.0.0 (new package)
system-filepath-0.4.12 (new version)
unix-2.7.0.1 (new version)
directory-1.2.1.0 (new version)
network-2.6.0.1 (new version)
process-1.2.0.0 (new version)
hslogger-1.2.4 (reinstall) changes: directory-1.2.0.1 -> 1.2.1.0,
network-2.4.1.2 -> 2.6.0.1, process-1.1.0.2 -> 1.2.0.0, unix-2.6.0.1 ->
2.7.0.1
sendfile-0.7.9 (reinstall) changes: bytestring-0.10.0.2 -> 0.10.4.0,
network-2.4.1.2 -> 2.6.0.1
utf8-string-0.3.8 (reinstall) changes: bytestring-0.10.0.2 -> 0.10.4.0
zlib-0.5.4.1 (reinstall) changes: bytestring-0.10.0.2 -> 0.10.4.0
happstack-server-7.3.8 (reinstall) changes: bytestring-0.10.0.2 -> 0.10.4.0,
directory-1.2.0.1 -> 1.2.1.0, network-2.4.1.2 -> 2.6.0.1, network-uri-2.6.0.0
added, parsec-3.1.3 -> 3.1.5, process-1.1.0.2 -> 1.2.0.0,
system-filepath-0.4.11 -> 0.4.12, text-0.11.3.1 -> 1.1.1.3, unix-2.6.0.1 ->
2.7.0.1
Warning: The following packages are likely to be broken by the reinstalls:
websockets-0.8.2.3
haste-compiler-0.3
zlib-bindings-0.1.1.5
io-streams-1.1.4.4
zip-archive-0.2.2.1
haskell-platform-2013.2.0.0
Use --force-reinstalls if you want to install anyway.

这很奇怪,怎么会破坏不相关的(不是happstacks依赖树的一部分)包?

此时,完全擦除我的Haskell环境并从头开始安装所有内容是否有意义?

0 个答案:

没有答案