在OSX 10.9.5上安装haskell-src-exts-1.16.0失败。

4

我的环境:

我执行了cabal install alexcabal install happy。确认cabal二进制路径已添加到我的$PATH中,路径为$(HOME)/Library/Haskell/bin/

cabal install haskell-src-exts出现了以下编译错误:

[19 of 22] Compiling Language.Haskell.Exts.InternalParser ( dist/build/Language/Haskell/Exts/InternalParser.hs, dist/build/Language/Haskell/Exts/InternalParser.o )

templates/GenericTemplate.hs:104:22:
    Couldn't match expected typeBool
                with actual typeHappy_GHC_Exts.Int#’
    In the expression:
      (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
    In a stmt of a pattern guard for
                   a case alternative:
      (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
    In a case alternative:
        n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
          -> (happyReduceArr Happy_Data_Array.! rule) i tk st
          where
              rule
                = (Happy_GHC_Exts.I#
                     ((Happy_GHC_Exts.negateInt#
                         ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))

templates/GenericTemplate.hs:115:23:
    Couldn't match expected typeBool
                with actual typeHappy_GHC_Exts.Int#’
    In the expression:
      (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))
    In the expression:
      if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
          (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
      else
          False
    In an equation for ‘check’:
        check
          = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
                (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
            else
                False

templates/GenericTemplate.hs:117:30:
    Couldn't match expected typeHappy_GHC_Exts.Int#’
                with actual typeBool
    In the expression: False
    In the expression:
      if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
          (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
      else
          False

templates/GenericTemplate.hs:119:13:
    Couldn't match expected typeBool
                with actual typeHappy_GHC_Exts.Int#’
    In the expression: check
    In a stmt of a pattern guard for
                   a pattern binding:
      check

templates/GenericTemplate.hs:212:14:
    Pattern bindings containing unlifted types should use an outermost bang pattern:
      (sts1@((HappyCons (st1@(action)) (_))))
        = happyDrop k (HappyCons (st) (sts))
    In an equation for ‘happyMonadReduce’:
        happyMonadReduce k nt fn j tk st sts stk
          = happyThen1
              (fn stk tk)
              (\ r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
          where
              (sts1@((HappyCons (st1@(action)) (_))))
                = happyDrop k (HappyCons (st) (sts))
              drop_stk = happyDropStk k stk

templates/GenericTemplate.hs:219:14:
    Pattern bindings containing unlifted types should use an outermost bang pattern:
      (sts1@((HappyCons (st1@(action)) (_))))
        = happyDrop k (HappyCons (st) (sts))
    In an equation for ‘happyMonad2Reduce’:
        happyMonad2Reduce k nt fn j tk st sts stk
          = happyThen1
              (fn stk tk)
              (\ r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
          where
              (sts1@((HappyCons (st1@(action)) (_))))
                = happyDrop k (HappyCons (st) (sts))
              drop_stk = happyDropStk k stk
              (off) = indexShortOffAddr happyGotoOffsets st1
              (off_i) = (off Happy_GHC_Exts.+# nt)
              ....
Failed to install haskell-src-exts-1.16.0
cabal: Error: some packages failed to install:
haskell-src-exts-1.16.0 failed during the building phase. The exception was:
ExitFailure 1

就记录而言,这也影响了我在Ubuntu 15.10上的使用。 - Joe
2个回答

7
似乎是已知问题。如果我理解正确,你只需要更新happy
补充:这里有详细的问题描述。

感谢提供完整的参考资料。结果发现更新 Happy 工具成功解决了问题。在我的情况下,有一个软链接 /usr/bin/happy -> /Library/Haskell/bin/happy,它是一个旧版本,我没有注意到。因此,我重新排列了我的 PATH 为 $(HOME)/Library/Haskell/bin : ${PATH},一切都很顺利。 - southp

0
我们为了解决这个问题所做的是在 cabal sandboxed 模式下分别安装 happyalex。然后,我们将二进制文件复制过去,一切都很顺利...

嗨。我不确定是否和我一样遇到了相同的路径问题。我的系统中有一个较旧版本的全局安装的 happy,它掩盖了我本地安装的最新版 happy。虽然我不确定为什么会有一个全局安装的版本。 - southp

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