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

GHC 8 Support #163

Open
xich opened this issue Jan 14, 2016 · 19 comments
Open

GHC 8 Support #163

xich opened this issue Jan 14, 2016 · 19 comments

Comments

@xich
Copy link
Member

xich commented Jan 14, 2016

Just so no one else wastes the time, I'm pretty far along on updating HERMIT to build with GHC 8 RC1, and plan to finish it up tonight.

@xich
Copy link
Member Author

xich commented Jan 15, 2016

Well, I think I'm past all the hard stuff, but its taking longer than expected, so probably another day.

@RyanGlScott
Copy link
Member

It just hit me that I promised Neil a while back that I'd update HERMIT to use kure-3.0, but time got away from me :(

Are you updating to kure-3.0 on the way?

@xich
Copy link
Member Author

xich commented Jan 15, 2016

Not in this diff... I figure that will be pretty major in itself. I can have a go at it though.

@xich
Copy link
Member Author

xich commented Jan 16, 2016

Just pushed da8af6b, which makes HERMIT compile with GHC 8. This is not the whole story. (There are TODOs in the commit message, which I plan to address this weekend or next week.)

Also, the only remaining dependency to sort out is the exceptions package. I installed a custom one with bounds on transformers and template-haskell bumped to < 0.6 and < 2.12 respectively.

@xich
Copy link
Member Author

xich commented Jan 16, 2016

Oh wait, new exceptions got released today, but I think with a too-tight bound on transformers-compat. Anyway, hopefully all this gets sussed out in the next few days and travis can start building for us.

@RyanGlScott
Copy link
Member

More bookkeeping: there was talk earlier of replacing marked-pretty with the new annotated version (1.1.3+) of pretty that comes bundled with GHC 8.0. I don't know if we want to do this now and use marked-pretty as a fallback, or if we want to wait until only GHC 8.0+ is supported. This comment provides a sketch of the changes needed.

@xich
Copy link
Member Author

xich commented Jan 16, 2016

I think we should just wait until we drop 7.10 support before we move over to pretty.

@conal
Copy link
Contributor

conal commented Feb 25, 2016

I'm trying to track down what I think is a GHC bug, so I'm installing GHC HEAD from Git sources. I get the following error message when compiling a freshly git-pulled HERMIT:

src/HERMIT/External.hs:60:45: error:
    Module 'Data.Typeable.Internal’ does not export 'funTc’

@xich
Copy link
Member Author

xich commented Feb 25, 2016

@conal Richard renamed that to tcFun in ghc/ghc@6746549

Best fix would be to move that import to HERMIT.GHC, CPP wrap it to get both versions, then define funTc = Data.Typeable.Internal.funTc or funTc = Data.Typeable.Internal.tcFun in HERMIT.GHC and export that to HERMIT.External. We try to use HERMIT.GHC to provide a consistent API across GHC versions, so we don't have to add CPP through the codebase.

@conal
Copy link
Contributor

conal commented Feb 25, 2016

@xich Sounds good. I think it'll be a little more involved, since tcFun isn't exported. I think we can rebuild it with exported interfaces. I'm happy to give it a shot now. Should I wrap with #if __GLASGOW_HASKELL__ > 710?

@conal
Copy link
Contributor

conal commented Feb 25, 2016

Oh, and maybe we'd rather use the more modern name, tcFun, with the intent to drop the CPP wrapping and use the Data.Typeable.Internal version directly at some point. Thoughts?

@conal
Copy link
Contributor

conal commented Feb 25, 2016

I made the changes, using the older name "funTc" for now. Included in my pull request #172 . I didn't intend to combine pull requests. I guess I don't understand how to keep them separate.

@xich
Copy link
Member Author

xich commented Feb 25, 2016

Ah, if it is not exported, let's just create our own:

tcFun = typeRepTyCon (typeRep (Proxy :: Proxy (Int -> Int)))

Has the added benefit of not needing the Internal module at all. All that stuff is in Data.Typeable.

@xich
Copy link
Member Author

xich commented Feb 25, 2016

Also might not even need CPP with that definition.

@conal
Copy link
Contributor

conal commented Feb 25, 2016

Good idea. I'll change it and re-push.

@conal
Copy link
Contributor

conal commented Feb 25, 2016

When I give that tcFun definition type TyCon, I get an error (with GHC 7.10.3):

Couldn't match expected type ‘TyCon’
            with actual type ‘Data.Typeable.Internal.TyCon’
NB: ‘TyCon’ is defined in ‘TyCon’ in package ‘ghc-7.10.3’
    ‘Data.Typeable.Internal.TyCon’
      is defined in ‘Data.Typeable.Internal’ in package ‘base-4.8.2.0’

Instead, I'm using type Data.Typeable.Internal.TyCon. Do you know what's going on here?

@conal
Copy link
Contributor

conal commented Feb 25, 2016

Okay. Updated pull request #172.

@xich
Copy link
Member Author

xich commented Feb 25, 2016

Yeah, GHC has it's own TyCon type, which is different than the TyCon type in Data.Typeable... hence the error.

I'll comment on the pull request.

@conal
Copy link
Contributor

conal commented Feb 25, 2016

Oh! Thanks for the explanation.

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

3 participants