hello!
Some stack commands return the following error message:
recoverEncode: invalid argument (invalid character)
It seems this happens for some particular locale settings.
How to reproduce (I used resolver lts-8.11, assuming this is not dependent of the resolver version):
$ cabal fetch hello
$ tar xaf ~/.cabal/packages/hackage.haskell.org/hello/1.0.0.2/hello-1.0.0.2.tar.gz .
cd hello-1.0.0.2/
stack init
stack build
$ LANG= stack --resolver=lts-8.11 exec which hello
recoverEncode: invalid argument (invalid character)
$ LANG=C stack --resolver=lts-8.11 exec which hello
recoverEncode: invalid argument (invalid character)
$ LANG=C.UTF-8 stack --resolver=lts-8.11 exec which hello
/home/damien/tmp/hello-1.0.0.2/.stack-work/install/x86_64-linux/lts-8.11/8.0.2/bin/hello
$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
This issue may be related: https://github.com/commercialhaskell/stack/issues/3101
best,
Damien
I'm unable to reproduce. (I noticed this issue when debugging an unrelated recoverEncode issue with a different project.)
Closing due to lack of repro
This problem just happened in our CI, inside a Docker container (based on a fresh debian:jessie image with Stack installed using curl -sSL https://get.haskellstack.org/ | sh).
FYI these are the lang env values by default in this image:
$ docker run --rm -it debian:jessie bash
root@acebccd762de:/# echo $LANG
root@acebccd762de:/# echo $LC_CTYPE
root@acebccd762de:/# echo $LC_ALL
In our case, this made a QuickCheck test (injecting a String) throw, which in turn failed our build.
We will modify our Dockerfile to add ENV LANG en_US.UTF-8 and see if things still break. However I think this issue deserves to be reopened, don't you agree?
PS: If you wonder why we don't build from Haskell Docker image, it's because we also use hw-kafka-client package which relies on Kafka bindings (librdkafka), and librdkafka is not supported (yet) on Debian Stretch, on which Haskell Docker image is based :(
Please reopen this issue. Can confirm @Sir4ur0n's comment. Mine is fixed from changing en_AU locale settings to en_US.
Most helpful comment
This problem just happened in our CI, inside a Docker container (based on a fresh
debian:jessieimage with Stack installed usingcurl -sSL https://get.haskellstack.org/ | sh).FYI these are the lang env values by default in this image:
In our case, this made a QuickCheck test (injecting a
String) throw, which in turn failed our build.We will modify our Dockerfile to add
ENV LANG en_US.UTF-8and see if things still break. However I think this issue deserves to be reopened, don't you agree?PS: If you wonder why we don't build from Haskell Docker image, it's because we also use
hw-kafka-clientpackage which relies on Kafka bindings (librdkafka), andlibrdkafkais not supported (yet) on Debian Stretch, on which Haskell Docker image is based :(