I have a package with bunch of *.c and *.cpp files, listed inside c-sources
field of *.cabal
file. I need to include it inside a project with IHaskell and some other packages. Everything works fine, and builds without a problem. stack exec ghci
works fine and I can import modules and execute any code. stack ghci
though throws some weird errors, like this:
In file included from <command-line>:10:0:
/...blabla.../.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h:157:0:
note: this is the location of the previous definition
#define CURRENT_PACKAGE_KEY "blabla"
^
And stack ghci
inside my package complains about symbols exported from its C code. Another weird thing is that symbols depend on the order of exposed-modules
in the configuration, so the error goes away if I put my *.hs module on top of others, but if I have two *.hs files importing from the same *.c file, it won't work! stack exec jupyter -- console --kernel haskell
starts, but immediately throws unknown symbol
error if I try to run some code from my package, always the same though.
I have a docker image based on fpco/stack-build
, which just installs jupyter and other necessary stuff. I use lts-3.0
snapshot, if it's somehow relevant.
What is going on?