3

I'm trying to cabal install fay fay-base. But it fails, here is the log:

$ 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.

Geradlus_RU
  • 1,466
  • 2
  • 20
  • 37
  • Successfully installed on Windows 8, GHC 7.6.3, cabal 1.18, happy 1.19, but to do that I have to run `cabal install ..` directly from local user folder to get happy being run from that, otherwise global happy v1.18 was used, and installation fails, meanwhile I have local directory (`users/../AppData/Roaming/cabal/bin`) in PATH environment variable. – Geradlus_RU Dec 26 '13 at 20:39

3 Answers3

5

Finally, I've done it this way:

  • uninstalled entire platform with sudo /Library/Haskell/bin/uninstall-hs (https://stackoverflow.com/a/6996284/1749901)
  • 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
    

Phew! Thank you all!

Community
  • 1
  • 1
Geradlus_RU
  • 1,466
  • 2
  • 20
  • 37
1

This is a known preprocessor issue on Mavericks. Look here for the solution.

The reasons why this looks like a preprocessor issue are:

  1. The line mentioned in the error message contains a CPP macro
  2. There's a known issue with CPP on Mavericks
  3. The package compiles fine with GHC 7.6.3 (which looks like the version you're using, too) here on Linux
Roman Cheplyaka
  • 37,738
  • 7
  • 72
  • 121
  • I've already there: `sudo /usr/bin/ghc-fix ALREADY PATCHED: /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/settings` – Geradlus_RU Dec 26 '13 at 16:40
  • I also have this warning: http://stackoverflow.com/questions/20785358/configuring-cabal-on-max-os-x-10-9 – Geradlus_RU Dec 26 '13 at 16:56
  • I updated the answer with why I think it's a preprocessor issue. Sadly, I have no further ideas on how to fix it. – Roman Cheplyaka Dec 26 '13 at 17:05
  • Maybe I should reinstall GHC, cabal and make proper configs immediately after installing, I mean PATH settings, patching, wrapping, etc. and then update cabal? Yes I have 7.6.3. Or maybe I should use some linux vm? – Geradlus_RU Dec 26 '13 at 18:47
  • I've also tried patch manually according to [this](http://justtesting.org/post/64947952690/the-glasgow-haskell-compiler-ghc-on-os-x-10-9), but have no luck. – Geradlus_RU Dec 26 '13 at 18:49
  • 1
    The version of Haskell Platform provided by Homebrew is patched and will work on OS X 10.9. That's what I recommend—nuke your existing installation and reinstall everything via Homebrew. – pash Dec 26 '13 at 22:00
  • @pash, just nuked and reinstalled all, but still having issue. How should I install entire platform with Homebrew, please provide a link if it possible. I not familiar with brew, and had troubles with MySQL in the past (brew made second installation of MySQL, which made it totally inaccessible), so I'm a bit scared about how it behaves :) – Geradlus_RU Dec 27 '13 at 12:09
  • Make sure you really wipe out your existing installation. You can use a script (like https://gist.github.com/steakknife/3775443), but also search your file system for "haskell", "ghc", etc., and delete what you find. Then a simple `brew install haskell-platform` should give you a fresh, working version of everything. (Note that Homebrew will install everything in `/usr/local` rather than `/Library/Frameworks`, etc. If `which ghc` doesn't turn up anything after installation, you might need to find the executables in `/usr/local/Cellar` and manually link or copy them into `/usr/local/bin`, etc.) – pash Dec 27 '13 at 16:54
0

All you need to do is add the cabal install directory to you path! Just add this to your .bash_profile:export PATH="$HOME/Library/Haskell/bin:$PATH"

export PATH="$HOME/Library/Haskell/bin:$PATH"

I was about to uninstall the entire platform, but then I found this to work on Mavericks.

r2jitu
  • 177
  • 1
  • 4