travis haskell构建失败,链接错误

时间:2015-11-27 15:22:14

标签: haskell github travis-ci

有一段时间了,我的小小的haskell应用程序的travis builds失败了一个神秘的链接错误:

$ cabal configure --enable-tests && cabal build && cabal test
Resolving dependencies...
[1 of 1] Compiling Main             ( Setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
/usr/lib/ghc/unix-2.5.1.0/libHSunix-2.5.1.0.a(execvpe.o): In function `pPrPr_disableITimers':
(.text+0x320): multiple definition of `pPrPr_disableITimers'
/home/travis/.cabal/lib/x86_64-linux-ghc-7.4.1/unix-2.7.1.0/libHSunix-2.7.1.0.a(ghcrts.o):ghcrts.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
The command "cabal configure --enable-tests && cabal build && cabal test" exited with 1.
Done. Your build exited with 1.

我的机器上的构建工作正常。我可以在我的.travis.yml文件中调整任何内容以解决问题吗?

2 个答案:

答案 0 :(得分:0)

根据我的经验,这通常是因为您的依赖关系树中有多个版本的库,cabal configure允许而cabal install不允许。我在构建日志中没有看到相关证据,但理论上可能会发生这种情况。您可以尝试将cabal configure更改为cabal install,看看会发生什么。

答案 1 :(得分:0)

所以,首先我对传统的travis系统,我想我需要继续新的。但是我认为那个需要更彻底的配置。遗留系统的第二个,不支持ghc 7.10:stackoverflow.com/questions/29516932 / ...我配置了7.10,但没有意识到这不起作用,因为travis没有认识到ghc版本,它只是把我最老的,7.4。所以我现在恢复到7.8,错误现在是不同的,更容易理解。 因此,由于我的配置错误,导致奇怪错误的根本原因是回归到相对古老的ghc 7.4。