#878113 cabal-install hangs after "hGetContents: invalid argument (invalid byte sequence)"

Package:
cabal-install
Source:
haskell-cabal-install
Description:
command-line interface for Cabal and Hackage
Submitter:
Ximin Luo
Date:
2017-10-09 23:51:05 UTC
Severity:
important
#878113#5
Date:
2017-10-09 23:47:27 UTC
From:
To:
Dear Maintainer,

| $ /usr/bin/cabal install cabal
| ghc: fd:12: hGetContents: invalid argument (invalid byte sequence)
| ^C
| 130

| $ /usr/bin/cabal install cabal --verbose
| /usr/bin/alex --version
| /usr/bin/gcc -dumpversion
| looking for tool haddock near compiler in /usr/bin
| found haddock in /usr/bin/haddock
| /usr/bin/haddock --version
| /usr/bin/happy --version
| /usr/bin/hpc version
| looking for tool hsc2hs near compiler in /usr/bin
| found hsc2hs in /usr/bin/hsc2hs
| /usr/bin/hsc2hs --version
| /usr/bin/ghc -hide-all-packages -c /tmp/16816927771714636915.c -o /tmp/1957747793424238335.o
| ghc: fd:12: hGetContents: invalid argument (invalid byte sequence)
| ^C
| 130

After some googling, I found [1] and [2], which helped me figure out a work-around:

| $ LC_ALL=en_US.iso88591 /usr/bin/cabal install cabal-install
| Resolving dependencies...
| Downloading Cabal-2.0.0.2...
| Downloading base16-bytestring-0.1.1.6...
| Configuring base16-bytestring-0.1.1.6...
| [..]
| Installed cabal-install-2.0.0.0

Obviously this isn't ideal since the user should be able to see error messages
in their own language.

[1] https://github.com/koalaman/shellcheck/issues/324
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786781