Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error with current ghc 7.8 snapshot #64

Closed
peti opened this issue Dec 3, 2013 · 7 comments
Closed

compile error with current ghc 7.8 snapshot #64

peti opened this issue Dec 3, 2013 · 7 comments

Comments

@peti
Copy link

peti commented Dec 3, 2013

haskell-src-exts 1.14.0 doesn't compile with the current GHC 7.8 snapshot:

[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 type ‛Bool’
                with actual type ‛Happy_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 type ‛Bool’
                with actual type ‛Happy_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 type ‛Happy_GHC_Exts.Int#’
                with actual type ‛Bool’
    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 type ‛Bool’
                with actual type ‛Happy_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)
              ....
@UnkindPartition
Copy link
Member

Please see #60. Hopefully the comments there will help you resolve this problem.

@peti
Copy link
Author

peti commented Dec 3, 2013

OK, I managed to fix the issue. The gist of it all is:

  1. The build needs Happy 1.19.x.
  2. cabal clean must be run to wipe out the obsolete Happy parser that's included in the distribution tarball. Without this step, no new parser will be generated.

@peti peti closed this as completed Dec 3, 2013
@geraldus
Copy link
Contributor

Tried to build ghcjs (manual) with GHC ver 7.8.20140130 on OS X 10.9.1 without success because of haskell-src-exts 1.14.0 installation fail.
To resolve this:

  • first I've updated happy from 1.19.2 to 1.19.3
cabal update
cabal install happy
  • then cabal clean inside clonned ghcjs repo (mandatory)

Now GHCJS and haskell-src-exts 1.14.0 both have been installed successfully.

Thanks.

@UnkindPartition
Copy link
Member

@geraldus this is fixed in haskell-src-exts 1.14.0.1

@mwotton
Copy link

mwotton commented Mar 5, 2014

@feuerbach I'm still getting this error with 1.14.0.1, and also with the latest github commit. Ah, updating to latest happy fixed it.

@UnkindPartition
Copy link
Member

@mwotton check that you have happy-1.19 installed and used by cabal

@mwotton
Copy link

mwotton commented Mar 5, 2014

yes, sorry - github comment failed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants