[GHC] #10543: MacOS: validate fails on \u

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.10.1 System | Operating System: MacOS X Keywords: | Type of failure: Building GHC Architecture: | failed Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Running validate on MacOS fails with this error (due to `-Werror`): {{{ libraries/Cabal/Cabal/Distribution/Simple/BuildTarget.hs:392:24: error: \u used with no following hex digits; treating as '\' followed by identifier [-Werror,-Wunicode] matchBuildTarget pkg = \utarget fexists -> ^ 1 error generated. make[1]: *** [utils/ghc-cabal/dist/build/tmp/ghc-cabal] Error 1 }}} I am using ghc from homebrew to bootstrap on OS X 10.10.3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => cpp * status: new => patch * differential: => Phab:D1004 Comment: Reproducible with: {{{ $ cat T10543.hs matchBuildTarget pkg = \utarget fexists -> undefined $ ghc -pgmP clang T10543.hs -fforce-recomp -cpp -Werror ...same error... }}}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Comment (by thomie): @trommler: could you try with the attached patch? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: invalid | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => invalid Comment: Please open an issue with Homebrew. This line shouldn't be there: https://github.com/Homebrew/homebrew/commit/b160b165d42f07abc912b1903095c593... #diff-e06a9de6bb362e22e1ceb9a66eaf171eR72 The GHC build system sets `-Wno-unicode` by default when HS_CPP_CMD is `clang`: {{{ $HS_CPP_CMD -x c /dev/null -dM -E > conftest.txt 2>&1 if grep "__clang__" conftest.txt >/dev/null 2>&1; then HS_CPP_ARGS="-E -undef -traditional -Wno-invalid-pp-token -Wno- unicode -Wno-trigraphs" }}] -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: invalid | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Comment (by rodlogic): For what is worth, I have created an issue with Homebrew [https://github.com/Homebrew/homebrew/issues/41777 here]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: invalid | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Comment (by geoff): So, I was the one to add this line — overriding `-Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs` — because these flags are not universally supported by clang. If anyone could help me understand this better, it would be appreciated. https://github.com/Homebrew/homebrew/issues/41777#issuecomment-122826887 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: invalid | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Comment (by rodlogic): Replying to [comment:5 geoff]:
So, I was the one to add this line — overriding `-Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs` — because these flags are not universally supported by clang. If anyone could help me understand this better, it would be appreciated. https://github.com/Homebrew/homebrew/issues/41777#issuecomment-122826887
I am not that familiar with GHC's build system, so I can't answer that. Hopefully someone else can? Here is the question, inlined: {{{ @rodlogic Is there a reason why the stage 0 bootstrap has to be built with -Werror? These warnings are pretty benign (indeed, more benign than the flags to suppress them). And what exactly is the significance of the \u in the source file, in this particular case? Support for unicode literals are not mandatory in POSIX in many places, and Mac OS X being a certified UNIX system, this is unlikely to change. The only way to reliably encode an arbitrary Unicode character in ASCII is is to use the octal sequences that comprise the glyph. Or, you could simply use the actual glyph, treating the source file as UTF-8, of course. But this seems particularly odd to me here, since the character that follows is t! So why is this needed here at all? What am I missing? }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

So, I was the one to add this line — overriding `-Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs` — because these flags are not universally supported by clang. If anyone could help me understand this better, it would be appreciated. https://github.com/Homebrew/homebrew/issues/41777#issuecomment-122826887 I added a comment to the homebrew ticket explaining that GHC uses cpp to
#10543: MacOS: validate fails on \u -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: invalid | Keywords: cpp Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1004 -------------------------------------+------------------------------------- Comment (by trommler): Replying to [comment:5 geoff]: process Haskell files and that `\utarget` is the start of a lambda abstraction and not some weird unicode. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10543#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC