Compile failure with GHC < 8
Closed this issue · 14 comments
You're using ghc flags that are supported only starting with GHC 8.0, and yet your package declares to be compatible with base versions prior to base-4.9:
Configuring component lib from config-ini-0.1.0.0
Preprocessing library config-ini-0.1.0.0...
src/Data/Ini/Config.hs:4:16:
unknown flag in {-# OPTIONS_GHC #-} pragma: -fno-warn-redundant-constraints
I suggest guarding the option with e.g. #if __GLASGOW_HASKELL__ >= 800
if you want to support versions prior to GHC 8.0
I ended up noticing this problem and and uploaded a new version before I noticed that this issue was open: the fix is in commit 2c82554 and is version 0.1.1.0
on Hackage.
I ended up opting to remove the pragma entirely, rather than guarding it with CPP: the -Wredundant-constraints
warning won't be part of -Wall
as soon as 8.0.2 lands (c.f. this thread and this associated pull request) which means that building on 8.0.{0,1} will produce a single redundant constraint warning, and building on both older and newer versions of GHC won't produce a warning at all.
Thanks! However, the config-ini-0.1.0.0
release also got flagged but for a different reason (namely AMP which happened in base-4.8):
Configuring component lib from config-ini-0.1.1.0
Preprocessing library config-ini-0.1.1.0...
[1 of 2] Compiling Data.Ini.Config.Raw ( src/Data/Ini/Config/Raw.hs, /tmp/matrix-worker/1479833305/dist-newstyle/build/x86_64-linux/ghc-7.8.4/config-ini-0.1.1.0/build/Data/Ini/Config/Raw.o )
src/Data/Ini/Config/Raw.hs:46:16:
Not in scope: ‘*>’
Perhaps you meant one of these:
‘*’ (imported from Prelude), ‘>>’ (imported from Prelude),
‘**’ (imported from Prelude)
src/Data/Ini/Config/Raw.hs:46:61:
Not in scope: ‘<*’
Perhaps you meant one of these:
‘*’ (imported from Prelude), ‘**’ (imported from Prelude),
‘<’ (imported from Prelude)
Also, I noticed cabal-version:>=1.14
being used which is undesirable as it doesn't provide any benefit (there were no features added to the .cabal format between 1.10 and 1.14) but instead causes only problems with older cabal
versions which choke on it :-)
Finally, I've noticed there is no bug-reports
entry which is useful for tooling and for users to know where the official issue tracker is, e.g.
bug-reports: https://github.com/aisamanra/config-ini/issues
To that end, I've edited the two releases on Hackage to help the cabal solver from avoiding such install-plans:
- https://hackage.haskell.org/package/config-ini-0.1.0.0/revisions/
- https://hackage.haskell.org/package/config-ini-0.1.1.0/revisions/
If you have any questions, please ask.
This seems to be happening again:
-- While building custom Setup.hs for package config-ini-0.2.3.0 using:
/home/simon/.stack/setup-exe-cache/i386-linux/Cabal-simple_mPHDZzAJ_1.22.5.0_ghc-7.10.3 --builddir=.stack-work/dist/i386-linux/Cabal-1.22.5.0 build --ghc-options " -ddump-hi $
Process exited with code: ExitFailure 1
Logs have been written to: /home/simon/src/hledger/.stack-work/logs/config-ini-0.2.3.0.log
Configuring config-ini-0.2.3.0...
Building config-ini-0.2.3.0...
Preprocessing library config-ini-0.2.3.0...
/tmp/stack30366/config-ini-0.2.3.0/src/Data/Ini/Config.hs:1:16:
unknown flag in {-# OPTIONS_GHC #-} pragma: -fno-warn-redundant-constraints```
@simonmichael I've performed a revision to mitigate the issue @ https://hackage.haskell.org/package/config-ini-0.2.3.0/revisions/
See also https://matrix.hackage.haskell.org/package/config-ini
Thanks @hvr.
@aisamanra, do you mean for latest config-ini to stop supporting ghc 7.10 ? It's not the end of the world, but it means hledger will, too.
Sorry about being slow to respond here!
When I was bumping the megaparsec
version I ran into a problem with 7.10 support and at the time wasn't sure how widely-used 7.10 was, so I [stopped testing it] it out of laziness, but I'm not at all opposed to maintaining 7.10 support if it would be helpful to have it!
@aisamanra If you decide to drop GHC 7.10 support, please advertise this by an accurate lower bound on base
so that the cabal solver can avoid running into broken build-plans with compile failures... Thanks! :-)
GHC 7.10 seems ancient to us frequent upgraders, and is outside our usual "last 3 major versions" window, but it's not yet 3 years old.
https://repology.org/metapackage/ghc/badges gives some idea of which distros still ship it. Not too many.. ubuntu 16.04 LTS is probably the biggest.
This was entirely a failure of diligence on my own part. Sorry about that! I've got a fix that appears to correctly restore 7.10 support, but given that this problem exists because I didn't test the previous one thoroughly enough, I'm going to give it a bit more of a workout before uploading it, and should have a 7.10-compatible version on Hackage in just a few hours.
@simonmichael btw, with the accelerated GHC release cycle the 3-rls window which was intended to be morally a ~3-year window rule is now become rather a 5-6 release window rule to serve the original rationale behind that rule
@simonmichael only problem though... not everyone got the memo nor was this considered when GHC HQ decided to speed up the GHC release rate... ;-)