-
Notifications
You must be signed in to change notification settings - Fork 641
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
Make Idris build with GHC8 #3226
Conversation
@KaneTW Thanks for the contribution, it is much appreciated. However, I think as the issue is an 'upstream' issue it might be best to wait until it is fixed before we start adding in fixes for Idris. Especially, if it means pulling in a development version of a dependency. Currently, the released version of Idris works with GHC prior to version 8.0. Although user's might have trouble installing Idris using cabal and GHC 8.0, I think that an valid and better work-around is to ask users to build the released version of Idris from source using stack. The current Stack configuration for Idris, that is released through hackage, will pull in an earlier version of GHC and will work with 'known to be working' package sets. By using LTS Haskell we can be presented with, and build using, stable releases of GHC and Hackage. My is opinion that stability is more important than being inline with upstream. Stack will migrate to GHC 8.0 at some point after the summer and will then bring known working packages with it [1,2]. With that, I am okay with waiting for upstream to fix itself, before we look to build Idris against GHC 8.0, and revisit supporting earlier versions of GHC. Although, I am happy for someone to convince me otherwise. |
I completely agree. I mostly did this so there's an easily accessible way to build with GHC8 for people who are interested. |
For what it's worth, I'd like to point out that as a result of this policy, Idris is literally the only Haskell formula in Homebrew that cannot build with GHC 8. I think it would be much better to patch Idris for the time being than to abdicate responsibility and rely on Stack to keep you afloat. |
Also, FYI: I've just shipped 0.12. |
@ilovezfs I think the policy is just that we wait to trifecta is properly released and not rely on a git version. I hope you see that that is a sensible policy. Thanks for shipping 0.12! |
@ahmadsalim You're welcome. I trust your judgment. Are you in contact with trifecta upstream about their situation? I'd just urge you guys to consider GHC 8 a high priority regardless of Stack's timetable. Also, this PR is failing for 0.12 and HEAD:
Note that I also had to throw in a cabal.config with |
@ilovezfs I am unsure what the current status is on communication, but we agreed on IRC that contacting the Trifecta developers might be a good idea. |
Arch Linux packaged the released version of Trifecta, they just "patched" the .cabal bounds: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/haskell-trifecta#n22 |
I'm wondering if the failure is due to the fact that I used vanilla cabal and not stack. I guess to get this PR to work with cabal, I'd need to handle the trifecta part manually, if that's the problem. |
@LeifW well Arch Linux could "just" use Stack as a workaround to package their binaries like I did: https://github.com/Homebrew/homebrew-core/blob/master/Formula/idris.rb#L23-L43 |
@ilovezfs Are you using the git version of Idris, or just patching the .cabal bounds on the released version? The ErrInfo type was introduced on git after the last release: ekmett/trifecta#54 (comment) |
I don't believe this patch relies on the git version of Trifecta; you could undo the changes that introduce ErrInfo if you wish to use it w/ release version of Trifecta (w/ appropriately adjusted cabal bounds to build on GHC 8). |
Correct. The important part is the instance DeltaParsing IdrisParser and adjusted bounds. ErrInfo isn't really necessary. |
@LeifW I think I can just grab trifecta as a resource at that revision and it should work. Will take a few minutes to find out :) |
@KaneTW BTW now looks like this PR applies to the release but no longer applies to HEAD. |
@ilovezfs I merged current master onto it. |
@KaneTW Hehe...I assume that will now cause it to fail against the release tarball? |
Voilà: Idris 0.12.0 built with GHC 8
|
@KaneTW Yeah, this still fails against HEAD (though it still applies to the release tarball right now):
|
Weird. It should apply, so I have no idea what's happening with stack.yaml there. I guess I could make a stack-ghc8.yaml? This is what my stack.yaml diff looks like
|
Yeah, that should work for a bound-adjusted trifecta version. |
@KaneTW @ahmadsalim I'm rather tempted to dump Stack and do this with the Homebrew formula:
|
That should work fine. |
@KaneTW Indeed it built and the test passes:
|
That patch also applies cleanly to HEAD
|
@KaneTW Doesn't Stack have an equivalent of cabal allow-newer? |
Huh. So it does. That makes this easier. Give me a moment. |
At least for cabal sandbox, technically there's no need to even patch trifecta surgically as above. Just need to add a "cabal.config" (and stack equivalent) at the root of the repository containing the single line
and the released trifecta can be used without modification. Not sure if that works for the regular runhaskell side of things too or if that needs its own version of the same? |
@ahmadsalim By the way you might also want to thank trifecta upstream for jumping on this: ekmett/trifecta#61 |
GHC8 travis config seems to work. |
There's an issue with Travis builds and a warning:
This fails due to -Werror on Travis. Setting iterations to 4m didn't work, and I couldn't go much higher due to memory constraints (tried 10m and it used ~8gb after a while) |
@KaneTW Interesting, it seems to relate to the following bug: https://ghc.haskell.org/trac/ghc/ticket/11822 . Apparently the new pattern matching checker, checks more than the old one (and is slower) and due to memory consumption they had to put a limit. |
OK, PR #3250 is now merged. |
Works on my machine. |
Travis jumps off the rails on GHC 7.6 and 7.8, already at cabal configure. There's nothing obvious in the PR that could cause that. |
@melted I have tried to restart the build, let us see if it is a Travis issue. |
It seems like it still fails. |
@KaneTW Sorry to bother again, would it be possible for you to add the Thanks for the patience |
I meant in the |
@ahmadsalim stupid question: have you checked if this affects master too? |
@ilovezfs As far as I can see from my PR from yesterday, it does not. |
The builds on master looks good I have built this branch locally with 7.8 and an old cabal so it likely isn't anything to do with the new dependency versions and old compilers. |
I have cloned this branch, activated travis on my idris-dev and pushed one with more logging to github. |
Found it, it's the new process bound that causes it. |
I'm going to merge this, failures and all, and put in my fix in a separate PR. |
@KaneTW @ahmadsalim @melted awesome work guys! 💯 |
@ahmadsalim @edwinb any outstanding blockers for a new tag? 😇 |
@ilovezfs As far as I understand the release will come very soon 😄 |
@ahmadsalim @edwinb any update on when the new release might be out? ilovezfs does his annoying child "Are we there yet?" thing again |
@ilovezfs Unfortunately, it is beyond my control so I can't say when. |
Just to reiterate the comments of @ahmadsalim @edwinb is responsible for cutting a release as they are currently tied in with development of the book. |
@ahmadsalim @edwinb @jfdm FYI: Homebrew/homebrew-core#3334 Thanks for the new release! |
Fixes #3193. Note that I used the git version of trifecta (stack.yaml has the respective commit) to build this (due to transformers bounds).
The GHC bug in question is https://ghc.haskell.org/trac/ghc/ticket/12201 and the actual workaround is a dummy DeltaParsing IdrisParser instance (which is identical to the (StateT s m) one)