Stack/Docker/IHaskell weird behaviour

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.

  • Install vim in node Docker image
  • Linking django and mysql containers using docker-compose
  • GitLab-CI multi runner start docker container
  • Azure App hosted docker port 25
  • Understanding Docker container resource usage
  • How to use SERVICE_CHECK_HTTP with progrium/consul check-http script?
  • 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?

  • App running on docker consuming page cache of host machine.Is that anti-pattern ?
  • Docker image extending the mysql image isn't running the initdb scripts
  • How to get readline working with python in alpine
  • docker-machine in docker on server
  • Docker For Mac Beta16 Error: Pinata Command Not Found
  • How to copy folders to docker image from Dockerfile?
  • One Solution collect form web for “Stack/Docker/IHaskell weird behaviour”

    There have been a lot of improvements made recently to stack ghci, which is still mostly a work in progress. I’d recommend testing out stack master, and if the problem still exists opening a Github issue.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.