The executable uses the following libraries: base, containers, scotty, bytestring, text, brick, regex-base, regex-pcre, array, http-conduit, http-types, http-client, vty. Do you think some of them might not be compatible at runtime? There is no information about that in the docs of these various libraries.
Whether it be stack exec or manual execution through retrieving the executable, I get the same error. The GHC options are in the package.yaml file of this project.
Only the library part does not have these options, but this library just contains type declarations that are common to the 2 executables in my project.
Alright nothing looks out of the ordinary there. Would you mind making a separate test project that contains:
import Control.Concurrent
main :: IO ()
main = getNumCapabilities >>= print
And making sure it compiles with the same ghc-options you have for your real project, can you run it and see if the same error appears? I’m trying to determine if the source of the problem is your machine, your config, or your deps as you original suspected.
It prints 8. Is this the number of cores on the machine? I can still update my project to GitHub so that you do not have to stick to the Discourse asking for precisions. Here is the link. I really want to thank you for your efforts, it is very kind.
Hi. Thanks for helping. I tried with stack exec and stack run and now it works. The raw executable works too… I still don’t understand what I have changed for it to start working…
I will probably mark the topic as solved even though I have no explanation, as it started to magically work.
By the way, I see you use cabal and not stack. Is there a specific reason for this? Isn’t stack supposed to be a wrapper around cabal to publish projects more easily?
Stack has the advantage of a fixed known good package set and better documentation. But that fixed package set has the disadvantage that it is harder to try out other versions or packages that are not included in the set. I’m more a student and hobbyist, so I don’t really care that much about stability and I am already knowledgeable about cabal, so I don’t need the extra documentation. Cabal is also lighter on disk space because dependencies are shared across projects and I think stack rebuilds dependencies for every project (.stack-work is always much larger than dist-newstyle). (Thanks for the correction @fosskers) I also like that cabal is developed by an independent group of open source contributors without commercial incentives and obligations. All in all I think cabal is the best choice for me, but I can understand why other people like stack more.
As a minor correction, stack does indeed share dependencies across projects. There’s nothing wrong with cabal, though I’ve always used stack since it offers me a few extra quality-of-life features that I’ve gotten used to over the years.