I maintain an open-source framework that uses CircleCI for continuous integration. I've recently hit a wall where the project suddenly refused to build in rather strange circumstances.
Build 27 was the last one that succeeded. After that, I made some minor changes to dependencies and noticed that the build fails. I've tried to fix it without success, so I reverted back to last working configuration and it still failed.
The reason for failure are two dependencies, both being bindings to native C libraries: OpenGL (OpenGLRaw
) and GLFW (bindings-glfw
). They error out in link stage with numerous lines of:
/tmp/ghc18975_0/ghc18975_6.o:(.data+0x0): multiple definition of `__stginit_bindizu0Qm7f8FzzUN32WFlos7AKUm_BindingsziGLFW'
/tmp/ghc18975_0/ghc18975_6.o:(.data+0x0): first defined here
I am totally stumped as for why that might happen. The exact same versions of those libraries were built back when the original build passed, and being on CI it uses a fresh container each time (I've tried cleaning the cache obviously). The build involves both apt-get update
and cabal update
though, so there's a possibility that some external resource was changed.
If anyone has ever encountered such or similar problem, it might vastly help in diagnosing and removing the issue. Google search for this specific multiple definition
problem of that scale yields nothing.
I tried to update cabal version (since some hints over the internet pointed at it), but with:
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
The problem persists.
One important thing I forgot to mention is that this doesn't look strictly like some simple package mixup. I connected over SSH to that box, created an empty folder and a sandbox there, and even simple cabal install OpenGLRaw
failed with the same problem (so it's unlikely that that itself would pull in two versions of the same module that could cause those conflicts).
I've also extracted a verbose cabal installation log.
Did SSH again, cloned raw sources of OpenGLRaw, still the same. Tried 7.6.3, still the same.