diff --git a/Cabal/Distribution/Simple/Compiler.hs b/Cabal/Distribution/Simple/Compiler.hs index 505f9cb1bb428a3d4dc09be318eb2d9fe2e7a2a7..02d0c9f7d7454bcbf1ffb47cb230f12e5b3b05ae 100644 --- a/Cabal/Distribution/Simple/Compiler.hs +++ b/Cabal/Distribution/Simple/Compiler.hs @@ -59,6 +59,7 @@ module Distribution.Simple.Compiler ( unitIdSupported, coverageSupported, profilingSupported, + backpackSupported, -- * Support for profiling detail levels ProfDetailLevel(..), @@ -316,6 +317,10 @@ packageKeySupported = ghcSupported "Uses package keys" unitIdSupported :: Compiler -> Bool unitIdSupported = ghcSupported "Uses unit IDs" +-- | Does this compiler support Backpack? +backpackSupported :: Compiler -> Bool +backpackSupported = ghcSupported "Support Backpack" + -- | Does this compiler support Haskell program coverage? coverageSupported :: Compiler -> Bool coverageSupported comp = diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index 4c6ffb2a9732fce0ab96de9841db4b51c9fdad23..656ac110cf2105458549a332674a61f6eee9798f 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -954,13 +954,18 @@ checkCompilerProblems comp pkg_descr enabled = do all (all (isDefaultIncludeRenaming . snd) . backpackIncludes) (enabledBuildInfos pkg_descr enabled)) $ die $ "Your compiler does not support thinning and renaming on " - ++ "package flags. To use this feature you probably must use " + ++ "package flags. To use this feature you must use " ++ "GHC 7.9 or later." when (any (not.null.PD.reexportedModules) (PD.allLibraries pkg_descr) && not (reexportedModulesSupported comp)) $ do die $ "Your compiler does not support module re-exports. To use " - ++ "this feature you probably must use GHC 7.9 or later." + ++ "this feature you must use GHC 7.9 or later." + + when (any (not.null.PD.signatures) (PD.allLibraries pkg_descr) + && not (backpackSupported comp)) $ do + die $ "Your compiler does not support Backpack. To use " + ++ "this feature you must use GHC 8.1 or later." -- | Select dependencies for the package. configureDependencies