From c01d92f52acb03e037ca6361aa937541d7a3a682 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 Forward-ported from 5339b36e7408b022abb7eeff4f8f1c7de54b8e50 Addresses #415 --- Cabal/Distribution/Simple/GHC.hs | 7 +++++++ Cabal/changelog | 1 + 2 files changed, 8 insertions(+) diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index 1fad59e6e0e..7dad7c0fe21 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 currently supports ghc >= 6.11 && < 8.7 + unless (ghcVersion < mkVersion [8,7]) $ + warn verbosity $ + "Unknown/unsupported 'ghc' version detected " + ++ "(Cabal " ++ display cabalVersion ++ " supports 'ghc' version < 8.7): " + ++ 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: diff --git a/Cabal/changelog b/Cabal/changelog index 41323ce428b..d658e163082 100644 --- a/Cabal/changelog +++ b/Cabal/changelog @@ -70,6 +70,7 @@ `D.S.findHookedPackageDesc` (#4874). * `D.S.getHookedBuildInfo` now takes an additional parameter specifying the build directory path (#4874). + * Emit warning when encountering unknown GHC versions (#415). * TODO 2.0.1.1 Mikhail Glushenkov December 2017