judah / terminfo

Haskell bindings to the terminfo API.
BSD 3-Clause "New" or "Revised" License
10 stars 10 forks source link

Fails preprocessing on macOS High Sierra Beta 5 #25

Closed Tehnix closed 7 years ago

Tehnix commented 7 years ago

Hey! I'm currently trying to build HIE on macOS High Sierra, and terminfo-0.4.1.0 seems to fail building with the following error in the process.

Doing,

git clone https://github.com/haskell/haskell-ide-engine
cd haskell-ide-engine
stack install

gets me,

--  While building package terminfo-0.4.1.0 using:
      /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/tehnix/GitHub/Clones/haskell-ide-engine/.stack-work/logs/terminfo-0.4.1.0.log

    [1 of 2] Compiling Main             ( /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/Setup.lhs, /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /Users/tehnix/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup ...
    Configuring terminfo-0.4.1.0...
    configure: WARNING: unrecognized options: --with-compiler
    checking for gcc... /usr/bin/gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether /usr/bin/gcc accepts -g... yes
    checking for /usr/bin/gcc option to accept ISO C89... none needed
    checking for setupterm in -ltinfo... no
    checking for setupterm in -lncursesw... no
    checking for setupterm in -lncurses... yes
    configure: creating ./config.status
    config.status: creating terminfo.buildinfo
    configure: WARNING: unrecognized options: --with-compiler
    Building terminfo-0.4.1.0...
    Preprocessing library terminfo-0.4.1.0...

    /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/System/Console/Terminfo/Base.hs:42:30: error:
         error: editor placeholder in source file
                                    (<#>),
                                     ^

    /private/var/folders/tp/1x1073c51vz4y9w545d3j_1h0000gn/T/stack3325/terminfo-0.4.1.0/System/Console/Terminfo/Base.hs:188:2: error:
         error: editor placeholder in source file
    (<#>) :: Monoid m => m -> m -> m
     ^
    2 errors generated.
    `gcc' failed in phase `C pre-processor'. (Exit code: 1)

It seems it might be related to https://ghc.haskell.org/trac/ghc/ticket/13805 - does anyone know how to "fix" this?

clang --version reports

Apple LLVM version 9.0.0 (clang-900.0.26)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

if that helps. I'm currently DL'ing Xcode Beta 5 to see if that solves the problems for some magic reason.

Tehnix commented 7 years ago

Seems installing the latest Xcode (beta 5) includes the patch that fixes the preprocessor.

Apple LLVM version 9.0.0 (clang-900.0.34.1)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin