-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hGetContents: invalid argument (invalid byte sequence) #96
Comments
Can you try passing the |
I should have said, I'm already using the |
By the way, it's failing in this file: https://github.com/ganeti/ganeti/blob/master/test/hs/Test/Ganeti/Attoparsec.hs#L45 |
OK, thanks for the test case, I'll take a look (probably Monday - my parents are in town this weekend). |
I noticed that it works well with |
My |
Thanks. Then I almost certainly just screwed up the flags and UTF8 no longer gets passed down as far as it should. Hopefully easy to fix. |
Bisection with
|
Looking into it more, I think |
I fixed the utf8 flag, but also made utf8 the default, so it should still work if you omit the flag. Released as hlint-1.9.12. |
BTW, thanks for your efforts tracking this down - made it easy enough that I could fix it quickly while my parents popped out :). I haven't used |
This uses `cabal configure` to determine which exact dependency versions we are compiling against, and ensures that these versions are used by passing -package-id flags to GHC. The `cabal configure` step makes the build fail before compiling / type checking if the user tries to compile against a dependency version we don't support; before, this case led to type errors which were not clearly user errors. This fixes issue ganeti#988. The output of `cabal configure` is also used to generate MIN_VERSION_* macros. MIN_VERSION_* macros are the standard way to build CPP dependency switches in Haskell packages, and they replace our custom macros (like PARALLEL3 and NO_REGEX_PCRE) which had to be hand-built for each dependency. We can now query the version of any Haskell dependency without having to manually add a flag via autoconf. All ghc and hlint invocations were adjusted to take these macros into account. This change introduces a Haskell-build-time dependency on cabal-install (for `cabal configure`) and the Cabal API (for obtaining the configured dependency versions and generating the macros). Any cabal version since Debian Squeeze is supported. Note that our use of Cabal does not imply any downloading of dependencies at build time, hermetic builds are unaffected by this change. For developers we now require hlint >= 1.8.60, to make use of its --cpp-file option. However, hlint >= 1.9.12 is recommended since for hlint >= 1.8.58 && < 1.9.12 the --utf8 flag is non-functional (see ndmitchell/hlint#96); this can be worked though by using the equivalent `--encoding=UTF-8` flag.
This uses `cabal configure` to determine which exact dependency versions we are compiling against, and ensures that these versions are used by passing -package-id flags to GHC. The `cabal configure` step makes the build fail before compiling / type checking if the user tries to compile against a dependency version we don't support; before, this case led to type errors which were not clearly user errors. This fixes issue ganeti#988. The output of `cabal configure` is also used to generate MIN_VERSION_* macros. MIN_VERSION_* macros are the standard way to build CPP dependency switches in Haskell packages, and they replace our custom macros (like PARALLEL3 and NO_REGEX_PCRE) which had to be hand-built for each dependency. We can now query the version of any Haskell dependency without having to manually add a flag via autoconf. All ghc and hlint invocations were adjusted to take these macros into account. This change introduces a Haskell-build-time dependency on cabal-install (for `cabal configure`) and the Cabal API (for obtaining the configured dependency versions and generating the macros). Any cabal version since Debian Squeeze is supported. Note that our use of Cabal does not imply any downloading of dependencies at build time, hermetic builds are unaffected by this change. For developers we now require hlint >= 1.8.60, to make use of its --cpp-file option. However, hlint >= 1.9.12 is recommended since for hlint >= 1.8.58 && < 1.9.12 the --utf8 flag is non-functional (see ndmitchell/hlint#96); this can be worked though by using the equivalent `--encoding=UTF-8` flag.
This uses `cabal configure` to determine which exact dependency versions we are compiling against, and ensures that these versions are used by passing -package-id flags to GHC. The `cabal configure` step makes the build fail before compiling / type checking if the user tries to compile against a dependency version we don't support; before, this case led to type errors which were not clearly user errors. This fixes issue ganeti#988. The output of `cabal configure` is also used to generate MIN_VERSION_* macros. MIN_VERSION_* macros are the standard way to build CPP dependency switches in Haskell packages, and they replace our custom macros (like PARALLEL3 and NO_REGEX_PCRE) which had to be hand-built for each dependency. We can now query the version of any Haskell dependency without having to manually add a flag via autoconf. All ghc and hlint invocations were adjusted to take these macros into account. This change introduces a Haskell-build-time dependency on cabal-install (for `cabal configure`) and the Cabal API (for obtaining the configured dependency versions and generating the macros). Any cabal version since Debian Squeeze is supported. Note that our use of Cabal does not imply any downloading of dependencies at build time, hermetic builds are unaffected by this change. For developers we now require hlint >= 1.8.60, to make use of its --cpp-file option. However, hlint >= 1.9.12 is recommended since for hlint >= 1.8.58 && < 1.9.12 the --utf8 flag is non-functional (see ndmitchell/hlint#96); this can be worked though by using the equivalent `--encoding=UTF-8` flag.
This uses `cabal configure` to determine which exact dependency versions we are compiling against, and ensures that these versions are used by passing -package-id flags to GHC. The `cabal configure` step makes the build fail before compiling / type checking if the user tries to compile against a dependency version we don't support; before, this case led to type errors which were not clearly user errors. This fixes issue #988. The output of `cabal configure` is also used to generate MIN_VERSION_* macros. MIN_VERSION_* macros are the standard way to build CPP dependency switches in Haskell packages, and they replace our custom macros (like PARALLEL3 and NO_REGEX_PCRE) which had to be hand-built for each dependency. We can now query the version of any Haskell dependency without having to manually add a flag via autoconf. All ghc and hlint invocations were adjusted to take these macros into account. This change introduces a Haskell-build-time dependency on cabal-install (for `cabal configure`) and the Cabal API (for obtaining the configured dependency versions and generating the macros). Any cabal version since Debian Squeeze is supported. Note that our use of Cabal does not imply any downloading of dependencies at build time, hermetic builds are unaffected by this change. For developers we now require hlint >= 1.8.60, to make use of its --cpp-file option. However, hlint >= 1.9.12 is recommended since for hlint >= 1.8.58 && < 1.9.12 the --utf8 flag is non-functional (see ndmitchell/hlint#96); this can be worked though by using the equivalent `--encoding=UTF-8` flag. Signed-off-by: Niklas Hambuechen <[email protected]> Reviewed-by: Klaus Aehlig <[email protected]>
We now require cabal-install and the Cabal API for building, and hlint >= 1.9.12 since oder versions either did not support the --cpp-file option or had a bug regarding the --utf8 option (which we use; see ndmitchell/hlint#96).
We now require cabal-install and the Cabal API for building, and hlint >= 1.9.12 since oder versions either did not support the --cpp-file option or had a bug regarding the --utf8 option (which we use; see ndmitchell/hlint#96).
We now require cabal-install and the Cabal API for building, and hlint >= 1.9.12 since oder versions either did not support the --cpp-file option or had a bug regarding the --utf8 option (which we use; see ndmitchell/hlint#96). Signed-off-by: Niklas Hambuechen <[email protected]> Reviewed-by: Helga Velroyen <[email protected]>
I'm still getting this error with hlint 1.9.21 and 1.9.20 (1.9.19 works fine, though). |
@xor-xor I'm unaware of any changes that happened with 1.9.20. Can you tell me exactly what you are running, what the error is etc. |
It's weird... I can't reproduce this problem today. Maybe because I've made some changes to the file that I was hlinting (and yes, I forgot to make a copy of it when I encountered this problem - but I think that there was nothing special about this file). The error message was:
(I'm on OS X 10.9.5 w/ Haskell Platform 2014.2.0.0; hlint installed in a sandbox) If I manage to reproduce that somehow, I'll let you know. Sorry for the noise! 😉 |
I always appreciate bug reports, even if they can't reproduce later, so thanks! Any chance you were using CPP with include files? If not, let's ignore it til it resurfaces. |
Running hlint v1.9.11 on my file containing unicode characters, I get:
The problem is explained by @hvr here: finnsson/template-helper#2
The text was updated successfully, but these errors were encountered: