无法安装GHCJS DOM包

时间:2016-01-12 22:13:15

标签: haskell dom ghcjs

我正在尝试安装GHCJS。当我运行cabal install ghcjs-dom时,它会告诉我

Cannot find gtk2hsC2hs
Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).

好的,我们去吧......

~/Haskell/ghcjs-test/domTest: cabal install gtk2hs-buildtools
Resolving dependencies...
Configuring gtk2hs-buildtools-0.13.0.5...
Building gtk2hs-buildtools-0.13.0.5...
Failed to install gtk2hs-buildtools-0.13.0.5
Build log ( /Users/markkaravan/.cabal/logs/gtk2hs-buildtools-0.13.0.5.log ):
Configuring gtk2hs-buildtools-0.13.0.5...
Building gtk2hs-buildtools-0.13.0.5...
Preprocessing executable 'gtk2hsTypeGen' for gtk2hs-buildtools-0.13.0.5...
[1 of 2] Compiling Paths_gtk2hs_buildtools ( dist/build/autogen/Paths_gtk2hs_buildtools.hs, dist/build/gtk2hsTypeGen/gtk2hsTypeGen-tmp/Paths_gtk2hs_buildtools.o )
[2 of 2] Compiling Main             ( hierarchyGen/TypeGen.hs, dist/build/gtk2hsTypeGen/gtk2hsTypeGen-tmp/Main.o )
Linking dist/build/gtk2hsTypeGen/gtk2hsTypeGen ...
Preprocessing executable 'gtk2hsHookGenerator' for
gtk2hs-buildtools-0.13.0.5...
[1 of 2] Compiling Paths_gtk2hs_buildtools ( dist/build/autogen/Paths_gtk2hs_buildtools.hs, dist/build/gtk2hsHookGenerator/gtk2hsHookGenerator-tmp/Paths_gtk2hs_buildtools.o )
[2 of 2] Compiling Main             ( callbackGen/HookGenerator.hs, dist/build/gtk2hsHookGenerator/gtk2hsHookGenerator-tmp/Main.o )
Linking dist/build/gtk2hsHookGenerator/gtk2hsHookGenerator ...
Preprocessing executable 'gtk2hsC2hs' for gtk2hs-buildtools-0.13.0.5...
[ 1 of 41] Compiling DLists           ( c2hs/base/general/DLists.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/DLists.o )
[ 2 of 41] Compiling BaseVersion      ( c2hs/base/admin/BaseVersion.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/BaseVersion.o )
[ 3 of 41] Compiling Switches         ( c2hs/state/Switches.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Switches.o )
[ 4 of 41] Compiling Map              ( c2hs/base/general/Map.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Map.o )
[ 5 of 41] Compiling FastMutInt       ( c2hs/base/general/FastMutInt.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/FastMutInt.o )
[ 6 of 41] Compiling Config           ( c2hs/base/admin/Config.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Config.o )
[ 7 of 41] Compiling C2HSConfig       ( c2hs/toplevel/C2HSConfig.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/C2HSConfig.o )
[ 8 of 41] Compiling CInfo            ( c2hs/gen/CInfo.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CInfo.o )
[ 9 of 41] Compiling Version          ( c2hs/toplevel/Version.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Version.o )
[10 of 41] Compiling Binary           ( c2hs/base/general/Binary.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Binary.o )
[11 of 41] Compiling Position         ( c2hs/base/general/Position.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Position.o )
[12 of 41] Compiling UNames           ( c2hs/base/general/UNames.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/UNames.o )
[13 of 41] Compiling Errors           ( c2hs/base/errors/Errors.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Errors.o )
[14 of 41] Compiling Attributes       ( c2hs/base/syms/Attributes.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Attributes.o )
[15 of 41] Compiling Idents           ( c2hs/base/syms/Idents.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Idents.o )
[16 of 41] Compiling CTokens          ( c2hs/c/CTokens.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CTokens.o )
[17 of 41] Compiling CAST             ( c2hs/c/CAST.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CAST.o )
[18 of 41] Compiling CPretty          ( c2hs/c/CPretty.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CPretty.o )
[19 of 41] Compiling Lexers           ( c2hs/base/syntax/Lexers.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/Lexers.o )

c2hs/base/syntax/Lexers.hs:133:1: Warning: Tab character

c2hs/base/syntax/Lexers.hs:134:1: Warning: Tab character
...

c2hs/base/syntax/Lexers.hs:518:1: Warning: Tab character

c2hs/base/syntax/Lexers.hs:519:1: Warning: Tab character

c2hs/base/syntax/Lexers.hs:520:1: Warning: Tab character

c2hs/base/syntax/Lexers.hs:520:15: Warning: Tab character
[20 of 41] Compiling StateTrans       ( c2hs/base/state/StateTrans.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/StateTrans.o )
[21 of 41] Compiling StateBase        ( c2hs/base/state/StateBase.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/StateBase.o )
[22 of 41] Compiling NameSpaces       ( c2hs/base/syms/NameSpaces.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/NameSpaces.o )
[23 of 41] Compiling CAttrs           ( c2hs/c/CAttrs.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CAttrs.o )
[24 of 41] Compiling CBuiltin         ( c2hs/c/CBuiltin.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CBuiltin.o )
[25 of 41] Compiling CParserMonad     ( c2hs/c/CParserMonad.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CParserMonad.o )
[26 of 41] Compiling CLexer           ( dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CLexer.hs, dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CLexer.o )

dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CLexer.hs:463:29:
    Couldn't match expected type ‘Bool’ with actual type ‘Int#’
    In the first argument of ‘(&&)’, namely ‘(offset >=# 0#)’
    In the expression: (offset >=# 0#) && (check ==# ord_c)
    In the expression:
      if (offset >=# 0#) && (check ==# ord_c) then
          alexIndexInt16OffAddr alex_table offset
      else
          alexIndexInt16OffAddr alex_deflt s

dist/build/gtk2hsC2hs/gtk2hsC2hs-tmp/CLexer.hs:463:48:
    Couldn't match expected type ‘Bool’ with actual type ‘Int#’
    In the second argument of ‘(&&)’, namely ‘(check ==# ord_c)’
    In the expression: (offset >=# 0#) && (check ==# ord_c)
    In the expression:
      if (offset >=# 0#) && (check ==# ord_c) then
          alexIndexInt16OffAddr alex_table offset
      else
          alexIndexInt16OffAddr alex_deflt s
cabal: Error: some packages failed to install:
gtk2hs-buildtools-0.13.0.5 failed during the building phase. The exception
was:
ExitFailure 1

在这种情况下,弄乱这些有类型错误的源文件是否真的明智,或者有更好的方法来解决这个问题?

1 个答案:

答案 0 :(得分:2)

尝试更新alex(可能还有happy)。有关详细信息,请参阅此处:https://ro-che.info/articles/2014-03-08-happy-alex-ghc-7.8.html