-
Notifications
You must be signed in to change notification settings - Fork 843
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
stack and ghc don't work well on Windows when the user name has non-ASCII chars in it #3988
Comments
The kind people on the haskell-jp Slack let me know that many of them change their user names to ASCII chars in order to work around problems as covered by this issue. Let's make that a thing of the past! |
Found another issue: https://ghc.haskell.org/trac/ghc/ticket/15096
For the full invocation see #3987 (comment). |
Here is another: #3976 |
I just ran into this problem (as my name and windows username contains the letter Steps to reproduce:
Changing the code page of the shell to 65001 (UTF-8) does not fix the issue but triggers another exception:
Maybe this issue is also related to |
The way forward is simply using the new filepath types: https://hasufell.github.io/posts/2022-06-29-fixing-haskell-filepaths.html |
@kuchenkruste, thanks for reporting this. I'm a Windows user myself, so I want Stack to support fully Windows users (which is one of its stated goals). To help me understand better your circumstances, can you tell me your Windows version, the terminal software you are using, and the version of Stack ( |
I tied this experiment with Stack (which is not @kuchenkruste's problem, that problem is the path to the Stack-supplied GHC): I changed my Stack root to C:\test\björn\sr:
I commanded
GCC is GHC-supplied:
The version of GCC is:
My immediate reaction (I may be wrong) is that seems to be an upstream problem with the MSYS2-supplied I think the sorry answer is that Stack's ability to support 'björn' (etc) in some paths is currently constrained by the inability of the tools on which Stack relies to support it. |
Based on my experiments, @kuchenkruste, the 'raw' command:
would fail because the GHC-supplied GCC can't handle the path to I think the work-around is to use Stack's global YAML configuration ( |
I should add (1) I am using Windows Terminal on Windows 11 (with a UK/English set up) and (2) that my experiments included using GHC directly, with:
This fails with:
|
I am closing this issue because repeating my experiment above, things now work as intended. |
This is a meta-issue collecting all information about stack, and tools stack calls, failing in the case that you have a non-ASCII char in your user name on Windows.
For example, if you name your Windows user
日
so your home dir, including some stack related files, will be underC:\Users\日
.The goal for this issue to be closed is that you can just install stack and compile small and large big Haskell projects successfully without roadblocks, even when your user is named that way.
In general, there are two settings on Windows that affect the encoding behaviour:
chcp
in cmd.exe or PowerShell)Extra problems in the usage of stack arise when you have are using paths with non-unicode file names, but have set the system locale set to
English (United states)
, like shown here:As per my current understanding, if programmed correctly, applications can be made to work no matter what your locale, code page, and user name is. When something doesn't work (as shown in various cases below), it usually indicates a bug in stack or (in most cases I've encountered so far) one of the upstream programs that it calls.
We'd like to fix all of those, in stack or upstreams, so that
Maintained list of known issues:
stack build
calls out toghc-pkg list
.stack setup
failing withcommitBuffer: invalid argument (invalid character)
stack setup
when stack tries to compile thestack-sanity-check
file.The text was updated successfully, but these errors were encountered: