编译错误building intero

Compilation error building intero

我无法在新的堆栈项目上使用 emacs,因为 intero 无法构建。

  1. 我刚刚在 ubuntu 16.04
  2. 上安装了 stack 1.6.3
  3. 我创建了一个新的 (lts-10.2) 堆栈项目 ('play') 使用:stack new play
  4. 当我尝试在 emacs 中打开源文件时,它无法构建 intero

    Intero is not installed in the Stack environment.
    
    Installing intero-0.1.24 automatically ...
    
    intero-0.1.24: configure
    intero-0.1.24: build
    
    --  While building custom Setup.hs for package intero-0.1.24 using:
    /home/wmorgan/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/wmorgan/haskell/play/.stack-work/logs/intero-0.1.24.log
    Configuring intero-0.1.24...
    Preprocessing executable 'intero' for intero-0.1.24..
    Building executable 'intero' for intero-0.1.24..
    [1 of 8] Compiling GhciTypes        ( src/GhciTypes.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciTypes.o )
    [2 of 8] Compiling GhciMonad        ( src/GhciMonad.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciMonad.o )
    [3 of 8] Compiling GhciTags         ( src/GhciTags.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciTags.o )
    [4 of 8] Compiling GhciInfo         ( src/GhciInfo.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciInfo.o )
    [5 of 8] Compiling GhciFind         ( src/GhciFind.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciFind.o )
    [6 of 8] Compiling Paths_intero     ( .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/autogen/Paths_intero.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/Paths_intero.o )
    [7 of 8] Compiling InteractiveUI    ( src/InteractiveUI.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/InteractiveUI.o )
    [8 of 8] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/Main.o )
    Linking .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero ...
    /usr/bin/ld.gold: error: cannot find -ltinfo
    collect2: error: ld returned 1 exit status
    `gcc' failed in phase `Linker'. (Exit code: 1)
    Could not install Intero!
    

(我也尝试过从命令行构建 intero,结果相同。)

编辑:如果我编辑 stack.yaml(在我的项目中)以使用 lts-9.5,那么 intero 构建正常 - 所以这个问题似乎是 lts-10.2 特定的。

关于如何解决这个问题有什么想法吗?

sudo apt-get install libncurses-dev

我通过此搜索找到了此信息https://github.com/commercialhaskell/intero/search?q=-ltinfo&type=Issues&utf8=%E2%9C%93 leading to https://github.com/commercialhaskell/intero/issues/456

我最近在 Kubuntu 18.04 上为 lts-11.8 项目安装 intero 时遇到了这个问题。问题是系统缺少 tinfo 库。以下命令为我解决了这个问题。

sudo apt-get install libtinfo-dev