Commit fd08c639 authored by ttuegel's avatar ttuegel

Fix 'cabal configure --enable-{tests,benchmarks}'.

'cabal configure' was not adding optional stanza constraints when checking
dependencies, causing '--enable-{tests,benchmarks}' to be silently ignored.
parent 18d01c6a
......@@ -137,6 +137,10 @@ planLocalPackage verbosity comp configFlags configExFlags installedPkgIndex
solver = fromFlag $ configSolver configExFlags
testsEnabled = fromFlagOrDefault False $ configTests configFlags
benchmarksEnabled =
fromFlagOrDefault False $ configBenchmarks configFlags
resolverParams =
addPreferences
......@@ -155,6 +159,15 @@ planLocalPackage verbosity comp configFlags configExFlags installedPkgIndex
[ PackageConstraintFlags (packageName pkg)
(configConfigurationsFlags configFlags) ]
. addConstraints
-- '--enable-tests' and '--enable-benchmarks' constraints from
-- command line
[ PackageConstraintStanzas (packageName pkg) $ concat
[ if testsEnabled then [TestStanzas] else []
, if benchmarksEnabled then [BenchStanzas] else []
]
]
$ standardInstallPolicy
installedPkgIndex
(SourcePackageDb mempty packagePrefs)
......
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