Installation fails with GHC < 8
ivanperez-keera opened this issue · 8 comments
I recently had to go to GHC 7.10* to compile a game that uses X11, and installation failed due to the change from -fno-warn-unused-binds
to -Wno-unused-binds
.
This is probably very low priority, but it would be great if the cabal files of X11-1.10* prevented installation with older GHCs so cabal picked X11-1.9.2, which was the latest version that used a flag compatible with GHC 7.10. Alternatively, you could also do:
if impl(ghc >= 8)
ghc-options: -Wno-unused-binds
else
ghc-options: -fno-warn-unused-binds
although you may not want to have to keep that around for very old, unsupported versions of GHC, which would be perfectly understandable.
*There was an outstanding bug in the GHC 8.* series that made some games break with GHC 8.*.
I think this was bumped because we dropped support for these older GHC versions in xmonad and -contrib. If the name of the flag is really the only reason why X11 does not compile in 7.10 right now, I don't see a reason why we shouldn't make that distinction in the cabal file
With the change above, X11-1.10.1 compiles with GHC 7.10.3 and the game I mentioned above works.
We can either add the condition or just switch back to only using -fno-warn-*
if that's still supported in GHC 9. Would be nice to open a PR that does either and also adds GHC 7.10 to the test matrix. The X11 library is unlikely to see significant changes, so supporting older GHCs shouldn't be a problem.
I don't have GHC 9 to try it, but everything in the docs seems to suggest that the syntax is with -W
. I see no reference to -fno-warn-*
flags anymore.
I can submit a PR including the condition and GHC 7.10 in the matrix.
Does anything need to change in https://github.com/xmonad/X11/blob/master/.github/workflows/haskell-ci.yml#L47-L48? (note: I have zero experience with github actions, which I guess it's what that's for).
I don't have GHC 9 to try it, but everything in the docs seems to suggest that the syntax is with
-W
. I see no reference to-fno-warn-*
flags anymore.
Those references weren't there in 8.10 docs either and I vaguely remember it still worked, so I'd say the easiest way is to just let the CI check it for us. :-)
Does anything need to change in https://github.com/xmonad/X11/blob/master/.github/workflows/haskell-ci.yml#L47-L48? (note: I have zero experience with github actions, which I guess it's what that's for).
This one's generated automatically from tested-with in .cabal by running haskell-ci regenerate
. I can regenerate that for you now that I'm back home with proper internet access.
I made a revision on Hackage for both 1.10 and 1.10.1 that bounds base to GHC8+ and I'll now release 1.10.2 that restores compat with GHC7.
Awesome! Thanks!
Sorry that I couldn't submit even a simple PR. It's been a crazy time.