无法在Mac OS X Mavericks上安装Fay

3
我正在尝试运行cabal install fay fay-base命令。但是它失败了,这里是日志记录:
$ cabal install fay fay-base
Resolving dependencies...
Configuring pretty-show-1.6.3...
Building pretty-show-1.6.3...
Preprocessing library pretty-show-1.6.3...
[1 of 6] Compiling Paths_pretty_show ( dist/build/autogen/Paths_pretty_show.hs, dist/build/Paths_pretty_show.o )
[2 of 6] Compiling Text.Show.Value  ( Text/Show/Value.hs, dist/build/Text/Show/Value.o )
[3 of 6] Compiling Text.Show.PrettyVal ( Text/Show/PrettyVal.hs, dist/build/Text/Show/PrettyVal.o )
[4 of 6] Compiling Text.Show.Html   ( Text/Show/Html.hs, dist/build/Text/Show/Html.o )

Text/Show/Html.hs:106:1: Warning: Defined but not used: `tallTuple'
[5 of 6] Compiling Text.Show.Parser ( dist/build/Text/Show/Parser.hs, dist/build/Text/Show/Parser.o )
[6 of 6] Compiling Text.Show.Pretty ( Text/Show/Pretty.hs, dist/build/Text/Show/Pretty.o )
[1 of 6] Compiling Paths_pretty_show ( dist/build/autogen/Paths_pretty_show.hs, dist/build/Paths_pretty_show.p_o )
clang: warning: argument unused during compilation: '-nodefaultlibs'
[2 of 6] Compiling Text.Show.Value  ( Text/Show/Value.hs, dist/build/Text/Show/Value.p_o )
clang: warning: argument unused during compilation: '-nodefaultlibs'
[3 of 6] Compiling Text.Show.PrettyVal ( Text/Show/PrettyVal.hs, dist/build/Text/Show/PrettyVal.p_o )
clang: warning: argument unused during compilation: '-nodefaultlibs'
[4 of 6] Compiling Text.Show.Html   ( Text/Show/Html.hs, dist/build/Text/Show/Html.p_o )

Text/Show/Html.hs:106:1: Warning: Defined but not used: `tallTuple'
clang: warning: argument unused during compilation: '-nodefaultlibs'
[5 of 6] Compiling Text.Show.Parser ( dist/build/Text/Show/Parser.hs, dist/build/Text/Show/Parser.p_o )
clang: warning: argument unused during compilation: '-nodefaultlibs'
[6 of 6] Compiling Text.Show.Pretty ( Text/Show/Pretty.hs, dist/build/Text/Show/Pretty.p_o )
clang: warning: argument unused during compilation: '-nodefaultlibs'
In-place registering pretty-show-1.6.3...
Preprocessing executable 'ppsh' for pretty-show-1.6.3...
[1 of 1] Compiling Main             ( bin/ppsh.hs, dist/build/ppsh/ppsh-tmp/Main.o )
Linking dist/build/ppsh/ppsh ...
Running Haddock for pretty-show-1.6.3...
Preprocessing library pretty-show-1.6.3...
Haddock coverage:
   0% (  0 /  8) in 'Paths_pretty_show'
 100% (  3 /  3) in 'Text.Show.Value'
  50% (  1 /  2) in 'Text.Show.PrettyVal'

dist/build/tmp-6355/Text/Show/Html.hs:106:1: Warning:
    Defined but not used: `tallTuple'
  71% (  5 /  7) in 'Text.Show.Html'
   0% (  0 /  2) in 'Text.Show.Parser'
  81% ( 21 / 26) in 'Text.Show.Pretty'
Documentation created: dist/doc/html/pretty-show/index.html
Preprocessing executable 'ppsh' for pretty-show-1.6.3...
Installing library in
/Users/arthurfayzrakhmanov/Library/Haskell/ghc-7.6.3/lib/pretty-show-1.6.3/lib
Installing executable(s) in
/Users/arthurfayzrakhmanov/Library/Haskell/ghc-7.6.3/lib/pretty-show-1.6.3/bin
Warning: The directory
/Users/arthurfayzrakhmanov/Library/Haskell/ghc-7.6.3/lib/pretty-show-1.6.3/bin
is not in the system search path.
Registering pretty-show-1.6.3...
Installed pretty-show-1.6.3
Configuring type-eq-0.4...
Building type-eq-0.4...
Preprocessing library type-eq-0.4...
[1 of 7] Compiling Type.Eq.Higher[boot] ( Type/Eq/Higher.hs-boot, dist/build/Type/Eq/Higher.o-boot )
[2 of 7] Compiling Type.Eq[boot]    ( Type/Eq.hs-boot, dist/build/Type/Eq.o-boot )
[3 of 7] Compiling Type.Eq.Unsafe   ( Type/Eq/Unsafe.hs, dist/build/Type/Eq/Unsafe.o )
[4 of 7] Compiling Type.Eq.Higher.Unsafe ( Type/Eq/Higher/Unsafe.hs, dist/build/Type/Eq/Higher/Unsafe.o )
[5 of 7] Compiling Type.Eq          ( Type/Eq.hs, dist/build/Type/Eq.o )
[6 of 7] Compiling Type.Eq.Higher   ( Type/Eq/Higher.hs, dist/build/Type/Eq/Higher.o )

Type/Eq/Higher.hs:72:86:
    Illegal literal in type (use -XDataKinds to enable): 1
Failed to install type-eq-0.4
Updating documentation index
/Users/arthurfayzrakhmanov/Library/Haskell/doc/index.html
cabal: Error: some packages failed to install:
fay-0.18.1.3 depends on type-eq-0.4 which failed to install.
fay-base-0.18.0.0 depends on type-eq-0.4 which failed to install.
haskell-names-0.3.2.4 depends on type-eq-0.4 which failed to install.
type-eq-0.4 failed during the building phase. The exception was:
ExitFailure 1

Please help.


成功安装于Windows 8上,包括GHC 7.6.3、cabal 1.18和happy 1.19。但为了这样做,我必须直接从本地用户文件夹运行'cabal install ..',以便让happy从那里运行,否则将使用全局的happy v1.18,而导致安装失败,同时我已将本地目录(users/../AppData/Roaming/cabal/bin)放在了PATH环境变量中。 - Geradlus_RU
3个回答

5
最终,我是这样做的:
  • uninstalled entire platform with sudo /Library/Haskell/bin/uninstall-hs (https://dev59.com/pWw15IYBdhLWcg3wA3CT#6996284)
  • then following this tutorial first installed apple-gcc42 via brew install apple-gcc42
  • then linked it brew link apple-gcc42
  • installed platform via brew install haskell-platform
  • cabal update
  • cabal install cabal-install
  • added to PATH $HOME/.cabal/bin (instead of $HOME/Library/Haskell/bin in case of when platform installed via PKG installer from here, obviously because brew makes a little bit different configurations).
  • source ~/.bash_profile, then relaunch terminal, so which cabal points to <HOME>/.cabal/bin/cabal, and cabal --version shows 1.18 (not 1.16).
  • cabal install happy. At this point I've relaunched terminal one more time, because which happy pointed to local updated (1.19.2) version, but happy --version showed 1.16.x.
  • cabal install type-eq -- SUCCEEDED first time!
  • finally, cabal install fay fay-base -- SUCCEEDED!

    Installed fay-0.18.1.3
    Installed fay-base-0.18.0.0
    

哎呀!谢谢大家!


感谢您在这里提供如此详细的信息!我相信它会帮助其他Mavericks用户。 - Adam Bergmark

1
这是Mavericks上已知的预处理器问题。在这里查看解决方案。
这看起来像是一个预处理器问题的原因是:
  1. 错误消息中提到的行包含CPP宏
  2. 在Mavericks上存在已知的CPP问题
  3. 该软件包在Linux上使用GHC 7.6.3编译正常(看起来您也在使用这个版本)

我已经在那里了:sudo /usr/bin/ghc-fix 已经修补:/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/settings - Geradlus_RU
我也尝试根据这个链接手动打补丁,但没有成功。 - Geradlus_RU
1
Homebrew 提供的 Haskell 平台版本已经修补过,并且可以在 OS X 10.9 上运行。我建议你删除现有的安装并通过 Homebrew 重新安装所有内容。 - pash
@pash,我刚刚把所有东西都清空并重新安装了,但问题仍然存在。请问我该如何使用Homebrew安装整个平台,如果有链接的话,请提供一下。我不熟悉brew,并且之前遇到过MySQL的麻烦(brew安装了第二个MySQL,导致根本无法访问),所以我有点害怕它会出现什么问题 :) - Geradlus_RU
请确保彻底清除您现有的安装。您可以使用脚本(例如https://gist.github.com/steakknife/3775443),但也要在文件系统中搜索“haskell”,“ghc”等,并删除找到的内容。然后,简单的`brew install haskell-platform应该为您提供一个新鲜、可用的版本。 (请注意,Homebrew将所有内容安装在/usr/local而不是/Library/Frameworks等中。如果安装后which ghc没有任何结果,则可能需要在/usr/local/Cellar中查找可执行文件并手动链接或复制它们到/usr/local/bin`等中。) - pash
显示剩余3条评论

0
你所需要做的就是将cabal安装目录添加到你的路径中!只需在.bash_profile文件中添加以下内容:export PATH="$HOME/Library/Haskell/bin:$PATH"
我本来打算卸载整个平台,但后来发现这个方法在Mavericks上可行。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接