I’ve been peacefully and happily working in Haskell for a year or so. I develop on an up-to-date Ubuntu system; my editor is emacs. At some point in the last couple weeks I started having problems that I’ve been unable to resolve, and I’m hoping someone can point me in the right direction.
Unfortunately by the time I noticed what was going on, I had already lost track of what changed from the working setup to now, but at the moment I believe that all of the relevant tools are installed either via nix-env or stack. The compiler is ghc 8.6.5.
The symptoms are somewhat varied, but boil down to the following message coming from invocation of “stack build”:
<stderr>: commitAndReleaseBuffer: invalid argument (invalid character)
According to the internet, this symptom seems to be related, at least sometimes, to the lack of proper Unicode encoding settings in the terminal invoking the build; my shell has LC_ALL set to en_US.UTF-8 though, so it’s probably something else (or at least a more subtle variant).
One version of the symptom occurs during intermediate stages of the build, seemingly at random. The build will stop at some point, with the above message, while building libraries from hackage. If I resume the build with an identical invocation of “stack build” then it will continue, working from where it left off. The computer does not seem to be running out of memory while this is happening, and there is plenty of swap and disk. The network connection seems to be stable too.
If I keep repeating “stack build,” eventually the build will complete. However, if I have inserted an error in one of my own source files (something like “x = y” at the end of my Main.hs, where “y” is not defined) then the error emitted at the end is also the above “commitAndReleaseBuffer” message, instead of the expected complaint that y is not in scope.
Except sometimes, after erasing .stack-work, and rebuilding with “stack build --silent”, I’ll see an actual error at the end. I’ve been flailing around so much on this that I’m really not certain, but there does seem to be something nondeterministic here.
Anyway, kind of at the end of my rope here and would appreciate some insight.