[GHC] #15096: GHC fails to execute gcc on Windows when unicode character is in the path

#15096: GHC fails to execute gcc on Windows when unicode character is in the path -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: 8.0.2 Keywords: | Operating System: Windows Architecture: | Type of failure: GHC doesn't work Unknown/Multiple | at all Test Case: | Blocked By: Blocking: | Related Tickets: #15021 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This happens when the location of gcc is under a path with non-ASCII directory in it: {{{ PS C:\Users\日\stack-test> & 'C:\Users\日 \AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.exe' -no- user-package-db .\Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) <no location info>: error: Warning: Couldn't figure out C compiler information! Make sure you're using GNU gcc, or clang Unable to start C:\Users\?\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin/realgcc.exe (error code: 123) `gcc.exe' failed in phase `Assembler'. (Exit code: 1) }}} Tested with ghc 8.0.2 on Windows Server 2016 (same setup as in #15021). This was discovered as part of the effort to make Haskell tooling work well for users with non-ASCII user names: https://github.com/commercialhaskell/stack/issues/3988 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15096 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15096: GHC fails to execute gcc on Windows when unicode character is in the path -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: GHC doesn't work | Unknown/Multiple at all | Test Case: Blocked By: | Blocking: Related Tickets: #15021 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by nh2: Old description:
This happens when the location of gcc is under a path with non-ASCII directory in it:
{{{ PS C:\Users\日\stack-test> & 'C:\Users\日 \AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.exe' -no- user-package-db .\Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o )
<no location info>: error: Warning: Couldn't figure out C compiler information! Make sure you're using GNU gcc, or clang Unable to start C:\Users\?\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin/realgcc.exe (error code: 123) `gcc.exe' failed in phase `Assembler'. (Exit code: 1) }}}
Tested with ghc 8.0.2 on Windows Server 2016 (same setup as in #15021).
This was discovered as part of the effort to make Haskell tooling work well for users with non-ASCII user names: https://github.com/commercialhaskell/stack/issues/3988
New description: This happens when the location of gcc is under a path with non-ASCII directory in it: {{{ PS C:\Users\日\stack-test> & 'C:\Users\日 \AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.exe' -no- user-package-db .\Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) <no location info>: error: Warning: Couldn't figure out C compiler information! Make sure you're using GNU gcc, or clang Unable to start C:\Users\?\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin/realgcc.exe (error code: 123) `gcc.exe' failed in phase `Assembler'. (Exit code: 1) }}} Tested with ghc 8.0.2 on Windows Server 2016 with the system locale set to `English (US)` (same setup as in #15021, see there for how to set the locale). This was discovered as part of the effort to make Haskell tooling work well for users with non-ASCII user names: https://github.com/commercialhaskell/stack/issues/3988 -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15096#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15096: GHC fails to execute gcc on Windows when unicode character is in the path -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: GHC doesn't work | Unknown/Multiple at all | Test Case: Blocked By: | Blocking: Related Tickets: #15021 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lehins): This seems very much related. If the `.hs` file has unicode chars in it, compilation will fail on Windows (regardless of the code page setting): {{{ PS C:\phab> ghc Я.hs [1 of 1] Compiling Main ( ?.hs, ?.o ) Assembler messages: Fatal error: can't create ?.o: Invalid argument `gcc.exe' failed in phase `Assembler'. (Exit code: 1) PS C:\phab> chcp 65001 Active code page: 65001 PS C:\phab> ghc Я.hs [1 of 1] Compiling Main ( Я.hs, Я.o ) Assembler messages: Fatal error: can't create ?.o: Invalid argument `gcc.exe' failed in phase `Assembler'. (Exit code: 1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15096#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC