[GHC] #13805: GHC 8.0.2 fails to build on macOS 10.13/Xcode 9 - preprocessor error in ghc-pkg

#13805: GHC 8.0.2 fails to build on macOS 10.13/Xcode 9 - preprocessor error in ghc-pkg -------------------------------------+------------------------------------- Reporter: mistydemeo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.0.2 Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: Building GHC (amd64) | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Building GHC 8.0.2 on macOS 10.13 fails with the following error when building {{{ utils/ghc-pkg/Main.hs:1269:40: error: error: editor placeholder in source file then termText (location db) <#> termText "\n (no packages)\n" ^ }}} I'm not very familiar with Haskell, but it looks to me like the C preprocessor is mistaking `<#>` for an invalid cpp directive instead of Haskell syntax. This is using the Xcode 9 beta (and its associated CLT), which ships "Apple LLVM version 9.0.0 (clang-900.0.22.8)". The same version should be available in the Xcode 9 beta for 10.12, but I haven't tested. The full build logs are available here: https://gist.github.com/anonymous/dc5f0c9d087f5d299f71393805c5d611 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13805 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13805: GHC 8.0.2 fails to build on macOS 10.13/Xcode 9 - preprocessor error in ghc-pkg -------------------------------------+------------------------------------- Reporter: mistydemeo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.0.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): It looks like we need to pass ` -fno-allow-editor-placeholders` in `CFLAGS`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13805#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13805: GHC 8.0.2 fails to build on macOS 10.13/Xcode 9 - preprocessor error in ghc-pkg -------------------------------------+------------------------------------- Reporter: mistydemeo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.0.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mistydemeo): After looking into it, I think the problem is that the editor placeholder check is too lax, which I've reported to clang with a patch: https://bugs.llvm.org/show_bug.cgi?id=33394 `<#>` doesn't meet the requirements because it has only a single hash, but the check matched it by accident. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13805#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13805: GHC 8.0.2 fails to build on macOS 10.13/Xcode 9 - preprocessor error in ghc-pkg -------------------------------------+------------------------------------- Reporter: mistydemeo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 8.0.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bollu): This was "fixed" for me by installing `gcc` and changing the settings file at `/usr/local/lib/ghc-8.0.2/settings` to: {{{ ... ("Haskell CPP command","gcc"), ("Haskell CPP flags","-E -undef -traditional -Wno-invalid-pp-token -Wno- unicode -Wno-trigraphs"), ... }}} (I replaced `clang` with `gcc`) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13805#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13805: GHC 8.0.2 fails to build on macOS 10.13/Xcode 9 - preprocessor error in ghc-pkg -------------------------------------+------------------------------------- Reporter: mistydemeo | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: ghc-pkg | Version: 8.0.2 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mistydemeo): * status: new => closed * resolution: => fixed Comment: Resolved with an upstream fix in clang: https://bugs.llvm.org/show_bug.cgi?id=33394 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13805#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC