1

I need help building Hakyll with CircleCI, I could not find much helper info about this error. The error seems to be on building dependency HsLua library, here is the stack logs I am getting:

...
`ScriptingziLua_dbgI'
/tmp/ghc14828_0/ghc_11.o:ghc_8.c:(.text+0x100): first defined here
/tmp/ghc14828_0/ghc_11.o: In function `ScriptingziLua_dbgR':
ghc_8.c:(.text+0x190): multiple definition of `ScriptingziLua_dbgR'
/tmp/ghc14828_0/ghc_11.o:ghc_8.c:(.text+0x190): first defined here
/tmp/ghc14828_0/ghc_11.o: In function `ScriptingziLua_dbh0':
ghc_8.c:(.text+0x260): multiple definition of `ScriptingziLua_dbh0'
/tmp/ghc14828_0/ghc_11.o:ghc_8.c:(.text+0x260): first defined here
collect2: error: ld returned 1 exit status
stack build --only-dependencies returned exit code 1

I tried using stack haskell with lts-5.18, locally is working fine, and with CircleCI is failing on building the HsLua library. I also tried using a predefined GHC machine in CircleCI (version: 7.10.2) and Cabal, but same error. I will appreciate some help on this, thx.

  • Possibly relevant https://stackoverflow.com/questions/34654262/build-fails-because-of-multiple-definition-linker-errors-in-native-dependencie/34811594#34811594 – Jan Tojnar Jan 07 '17 at 19:17
  • @JanTojnar Your comment was very helpful, thx. I fixed by adding another version of GCC in CircleCI. – Carlos Gómez Jan 07 '17 at 21:59

1 Answers1

1

Thx to @JanTojnar I've been able to fix this by adding a different GCC in my CircleCI:

machine:
   pre:
     - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
     - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
     - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 10
     - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 10