From 400dc208fae51bc7d5676cdf4f77da13c3625ff1 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 (cherry picked from commit 5339b36e7408b022abb7eeff4f8f1c7de54b8e50) --- 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 39929bd02a8..ddbc4425517 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.0 supports ghc >= 6.11 && < 8.3 + unless (ghcVersion < mkVersion [8,5]) $ + warn verbosity $ + "Unknown/unsupported 'ghc' version detected " + ++ "(Cabal " ++ display cabalVersion ++ " supports 'ghc' version < 8.3): " + ++ 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: