Skip to content

Don't pass unsupported flags to setups built with old Cabal versions. #1133

Merged
merged 1 commit into from Nov 29, 2012
View
17 cabal-install/Distribution/Client/Setup.hs
@@ -230,9 +230,20 @@ configureOptions = commandOptions configureCommand
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags flags cabalLibVersion
- | cabalLibVersion >= Version [1,3,10] [] = flags
- -- older Cabal does not grok the constraints flag:
- | otherwise = flags { configConstraints = [] }
+ | cabalLibVersion >= Version [1,14,0] [] = flags
+ | cabalLibVersion < Version [1,3,10] [] = flags_1_3_10
+ | cabalLibVersion < Version [1,10,0] [] = flags_1_10_0
+ | cabalLibVersion < Version [1,14,0] [] = flags_1_14_0
+
+ -- A no-op that silences the "pattern match is non-exhaustive" warning.
+ | otherwise = flags
+ where
+ -- Cabal < 1.14.0 doesn't know about --disable-benchmarks.
+ flags_1_14_0 = flags { configBenchmarks = NoFlag }
+ -- Cabal < 1.10.0 doesn't know about --disable-tests.
+ flags_1_10_0 = flags_1_14_0 { configTests = NoFlag }
+ -- Cabal < 1.3.10 does not grok the constraints flag.
+ flags_1_3_10 = flags_1_10_0 { configConstraints = [] }
-- ------------------------------------------------------------
-- * Config extra flags
Something went wrong with that request. Please try again.