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.

  • How to get this to work? Dockerfile FROM {YourPrivateRepo.azurecr.io/some/repo}
  • bluemix containers -> json: cannot unmarshal string into Go value of type []string
  • docker-compose service version error
  • What is POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1?
  • log tag option ignored by docker daemon
  • /proc/partitions within container not as expected
  • 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?

  • docker-compose up can't find module, but running from bash works
  • Docker : How to avoid Operation not permitted in Docker Container?
  • Timeout issue with a dockerized phantomjs
  • How to limit IO speed in docker with ceph rbd?
  • How to run docker-compose against docker swarm (without docker-machine)
  • Installing cron via apt-get fails in a docker ubuntu:12.04 container from permissions problems
  • 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.