Closed RyanGlScott closed 7 years ago
Oh dear, those Travis errors are interesting. I suppose it's because travis.hs
is invoking GHC directly on the source files, and older GHCs aren't aware of the MIN_VERSION_base
. One way you could fix it is with this change to travis.hs
:
diff --git a/travis.hs b/travis.hs
index 2b2bd73..a73a9b0 100644
--- a/travis.hs
+++ b/travis.hs
@@ -2,4 +2,4 @@
import System.Process.Extra
main = do
- system_ "runhaskell Main --test"
+ system_ "runhaskell --ghc-arg=-optP-include --ghc-arg=-optPdist/build/autogen/cabal_macros.h Main.hs --test"
Of course, this assumes that you always run travis.hs
after a build, and moreover, that you built it with cabal-install
specifically. Would this work for you, @ndmitchell?
Thanks for the patch! The #ifdef
was only required for GHC 7.2, so I just ended support for that (I had stopped testing it some time ago, so whether it still worked is somewhat academic).
FWIW, where CPP is required, I always try and make sure the code compiles with GHC alone, not relying on cabal. For base
, you can always just #ifdef
on the GHC version instead. For other packages, some #ifndef
branch defaulting to the latest available works.
I also released cmdargs-0.10.15 with this change.
The
Data.Typeable.Internal
module was removed inbase-4.10
/GHC 8.2. Luckily,cmdargs
only imports it for access totyConName
, a function which has been a part of the publicData.Typeable
interface for a while, so this can be fixed with some minimal CPP.