Commit 66dade37 authored by ttuegel's avatar ttuegel
Browse files

Fix backward compat option --enable-library-coverage

parent f445c3a3
...@@ -296,13 +296,7 @@ localBuildInfoFile distPref = distPref </> "setup-config" ...@@ -296,13 +296,7 @@ localBuildInfoFile distPref = distPref </> "setup-config"
configure :: (GenericPackageDescription, HookedBuildInfo) configure :: (GenericPackageDescription, HookedBuildInfo)
-> ConfigFlags -> IO LocalBuildInfo -> ConfigFlags -> IO LocalBuildInfo
configure (pkg_descr0, pbi) cfg configure (pkg_descr0, pbi) cfg
= do unless (configLibCoverage cfg == NoFlag) $ do = do let distPref = fromFlag (configDistPref cfg)
let enable | fromFlag (configLibCoverage cfg) = "enable"
| otherwise = "disable"
die $ "Option --" ++ enable ++ "-library-coverage is obsolete! "
++ "Please use --" ++ enable ++ "-coverage instead."
let distPref = fromFlag (configDistPref cfg)
buildDir' = distPref </> "build" buildDir' = distPref </> "build"
verbosity = fromFlag (configVerbosity cfg) verbosity = fromFlag (configVerbosity cfg)
...@@ -315,6 +309,13 @@ configure (pkg_descr0, pbi) cfg ...@@ -315,6 +309,13 @@ configure (pkg_descr0, pbi) cfg
("The flag --" ++ enable ++ "-executable-profiling is deprecated. " ("The flag --" ++ enable ++ "-executable-profiling is deprecated. "
++ "Please use --" ++ enable ++ "-profiling instead.") ++ "Please use --" ++ enable ++ "-profiling instead.")
unless (configLibCoverage cfg == NoFlag) $ do
let enable | fromFlag (configLibCoverage cfg) = "enable"
| otherwise = "disable"
warn verbosity
("The flag --" ++ enable ++ "-library-coverage is deprecated. "
++ "Please use --" ++ enable ++ "-coverage instead.")
createDirectoryIfMissingVerbose (lessVerbose verbosity) True distPref createDirectoryIfMissingVerbose (lessVerbose verbosity) True distPref
let programsConfig = mkProgramsConfig cfg (configPrograms cfg) let programsConfig = mkProgramsConfig cfg (configPrograms cfg)
...@@ -653,7 +654,7 @@ configure (pkg_descr0, pbi) cfg ...@@ -653,7 +654,7 @@ configure (pkg_descr0, pbi) cfg
else return True else return True
let lbi = LocalBuildInfo { let lbi = LocalBuildInfo {
configFlags = cfg, configFlags = cfg',
extraConfigArgs = [], -- Currently configure does not extraConfigArgs = [], -- Currently configure does not
-- take extra args, but if it -- take extra args, but if it
-- did they would go here. -- did they would go here.
......
...@@ -316,7 +316,7 @@ data ConfigFlags = ConfigFlags { ...@@ -316,7 +316,7 @@ data ConfigFlags = ConfigFlags {
configTests :: Flag Bool, -- ^Enable test suite compilation configTests :: Flag Bool, -- ^Enable test suite compilation
configBenchmarks :: Flag Bool, -- ^Enable benchmark compilation configBenchmarks :: Flag Bool, -- ^Enable benchmark compilation
configCoverage :: Flag Bool, -- ^Enable program coverage configCoverage :: Flag Bool, -- ^Enable program coverage
configLibCoverage :: Flag Bool, -- ^OBSOLETE. Just used to signal error. configLibCoverage :: Flag Bool, -- ^Enable program coverage (deprecated)
configExactConfiguration :: Flag Bool, configExactConfiguration :: Flag Bool,
-- ^All direct dependencies and flags are provided on the command line by -- ^All direct dependencies and flags are provided on the command line by
-- the user via the '--dependency' and '--flags' options. -- the user via the '--dependency' and '--flags' options.
...@@ -584,7 +584,7 @@ configureOptions showOrParseArgs = ...@@ -584,7 +584,7 @@ configureOptions showOrParseArgs =
(boolOpt [] []) (boolOpt [] [])
,option "" ["library-coverage"] ,option "" ["library-coverage"]
"build package with Haskell Program Coverage. (GHC only) (OBSOLETE)" "build package with Haskell Program Coverage. (GHC only) (DEPRECATED)"
configLibCoverage (\v flags -> flags { configLibCoverage = v }) configLibCoverage (\v flags -> flags { configLibCoverage = v })
(boolOpt [] []) (boolOpt [] [])
......
...@@ -389,6 +389,8 @@ filterConfigureFlags flags cabalLibVersion ...@@ -389,6 +389,8 @@ filterConfigureFlags flags cabalLibVersion
, configProfExe = configProf flags , configProfExe = configProf flags
, configProfLib = , configProfLib =
mappend (configProf flags) (configProfLib flags) mappend (configProf flags) (configProfLib flags)
, configCoverage = NoFlag
, configLibCoverage = configCoverage flags
} }
-- Cabal < 1.19.2 doesn't know about '--exact-configuration'. -- Cabal < 1.19.2 doesn't know about '--exact-configuration'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag } flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment