Can not build Hakyll with CircleCI

169 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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