Skip to content
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

Compilation error when building the executable with GHC 8.8.4 on Windows #9

Closed
f-f opened this issue Oct 10, 2020 · 7 comments
Closed

Comments

@f-f
Copy link

f-f commented Oct 10, 2020

with-utf8                  > Configuring with-utf8-1.0.2.1...
with-utf8                  > build
with-utf8                  > Preprocessing library for with-utf8-1.0.2.1..
with-utf8                  > Building library for with-utf8-1.0.2.1..
with-utf8                  > [1 of 6] Compiling Paths_with_utf8
with-utf8                  > [2 of 6] Compiling System.IO.Utf8.Internal
with-utf8                  > [3 of 6] Compiling System.IO.Utf8
with-utf8                  > [4 of 6] Compiling Main.Utf8
with-utf8                  > [5 of 6] Compiling Data.Text.Lazy.IO.Utf8
with-utf8                  > [6 of 6] Compiling Data.Text.IO.Utf8
with-utf8                  > Preprocessing executable 'utf8-troubleshoot' for with-utf8-1.0.2.1..
with-utf8                  > Building executable 'utf8-troubleshoot' for with-utf8-1.0.2.1..
with-utf8                  > [1 of 2] Compiling Main
with-utf8                  > 
with-utf8                  > app\utf8-troubleshoot\Main.hs:23:31: error:
with-utf8                  >     Module `GHC.IO.Encoding.Iconv' does not export `localeEncodingName'
with-utf8                  >    |
with-utf8                  > 23 | import GHC.IO.Encoding.Iconv (localeEncodingName)
with-utf8                  >    |                               ^^^^^^^^^^^^^^^^^^
with-utf8                  > 

Error from here

As you can see from the log above the library compiles fine, but the executable fails to (even though the base version in the build is supposed to contain the module). I cannot find a straightforward way to exclude the executable from the compilation, so I was wondering if it would be worth splitting it out in a separate package?

@adamburkegh
Copy link

Also saw this, ghc v8.8.4 on windows

$ stack build
with-utf8 > configure
with-utf8 > Configuring with-utf8-1.0.2.1...
with-utf8 > build
with-utf8 > Preprocessing executable 'utf8-troubleshoot' for with-utf8-1.0.2.1..
with-utf8 > Building executable 'utf8-troubleshoot' for with-utf8-1.0.2.1..
with-utf8 > [1 of 2] Compiling Main
with-utf8 >
with-utf8 > app\utf8-troubleshoot\Main.hs:23:31: error:
with-utf8 >     Module `GHC.IO.Encoding.Iconv' does not export `localeEncodingName'
with-utf8 >    |
with-utf8 > 23 | import GHC.IO.Encoding.Iconv (localeEncodingName)
with-utf8 >    |                               ^^^^^^^^^^^^^^^^^^
with-utf8 >
Progress 1/2

--  While building package with-utf8-1.0.2.1 (scroll up to its section to see the error) using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.4.exe --builddir=.stack-work\dist\29cc6475 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

@bhoudebert
Copy link

Hi anynews regarding this issue? We are still experiencing the same issue blocking for example installation of haskell-language-server

@PaulJohnson
Copy link

PaulJohnson commented Jan 4, 2021

As a temporary workaround, there is a fork without the troublesome troubleshoot executable on https://github.com/f-f/haskell-with-utf8

Go there, clone the repository and then add its folder as an extra package in your stack.yaml file.

@CarstenKoenig
Copy link

maybe an easier fix is to add this under extra-deps in your stack.yaml:

  - github: f-f/haskell-with-utf8
    commit: 8ae743ac6503a4c494ea3bd52f1fe7d72f9f125d

no need to clone the repository yourself

heitor-lassarote added a commit that referenced this issue Feb 15, 2021
Problem: Compilation of the executable on Windows fails with 'Module
`GHC.IO.Encoding.Iconv' does not export `localeEncodingName'`

Solution: Check if we are on Windows, and don't import such module or
use `localeEncodingName` if it's the case.
kirelagin added a commit that referenced this issue Feb 18, 2021
…-on-windows

[#9] Fix compilation of executable on Windows
@kirelagin
Copy link
Contributor

Hopefully, this is fixed now! Sorry for the delay, everyone 😞.

@kirelagin
Copy link
Contributor

I have uploaded v1.0.2.2 to Hackage and it includes this fix.

@f-f
Copy link
Author

f-f commented Feb 18, 2021

Thank you @kirelagin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants