From 5339b36e7408b022abb7eeff4f8f1c7de54b8e50 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Fri, 23 Feb 2018 16:18:33 +0100 Subject: [PATCH] Emit warning when an unknown GHC version is encountered This finally addresses the long-standing ticket #415 --- Cabal/Distribution/Simple/GHC.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index 1fad59e6e0e..37a94ddc558 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -131,6 +131,13 @@ configure verbosity hcPath hcPkgPath conf0 = do (userMaybeSpecifyPath "ghc" hcPath conf0) let implInfo = ghcVersionImplInfo ghcVersion + -- Cabal 2.2 supports ghc >= 6.11 && < 8.5 + unless (ghcVersion < mkVersion [8,5]) $ + warn verbosity $ + "Unknown/unsupported 'ghc' version detected " + ++ "(Cabal " ++ display cabalVersion ++ " supports 'ghc' version < 8.5): " + ++ programPath ghcProg ++ " is version " ++ display ghcVersion + -- This is slightly tricky, we have to configure ghc first, then we use the -- location of ghc to help find ghc-pkg in the case that the user did not -- specify the location of ghc-pkg directly: