堆栈安装失败,包安装错误

时间:2016-02-02 05:28:44

标签: haskell haskell-stack

我是第一次尝试让堆栈运行,但是在示例项目中运行stack setup(来自stack new helloworld new-template)失败并显示以下输出(我跳过了开头,我认为是正常的):

Installing library in
/home/ajl/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc7.10.2/ghc_JzwEp1oQ8kA7NFNTGk1ho5 "/home/ajl/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/ghc-pkg" --force --global-package-db "/home/ajl/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/package.conf.d" update rts/dist/package.conf.install
Reading package info from "rts/dist/package.conf.install" ... done.

: Warning: Unrecognized field 420 on line 420
(Skipped unrecognized field for every line 419 down to 1)
: Warning: Unrecognized field 1 on line 1
: missing id field
: invalid package identifier:
: invalid package key:
make[1]: *** [install_packages] Error 1
make: *** [install] Error 2

Installing GHC ...% 

我在Ubuntu 14.04上运行堆栈1.0.2。不确定它是否相关,但我已经在系统上安装了带有Cabal 1.23.0.0的ghc 7.10.1,工作正常。

我尝试将解析器更改为较旧的ghc版本的旧LTS版本。我也尝试删除~/.stack。鉴于错误的无益,不知道还有什么可以尝试。

1 个答案:

答案 0 :(得分:2)

I figured it out. The GHC build uses grep to make packages.conf.install. I have GREP_OPTIONS=--color=auto -n set in my zsh config. The -n was putting line numbers in front of everything, which was causing the errors.

The reason I couldn't find packages.conf.install anywhere before is because it is made on the fly during GHC make. And stack does that in /tmp.