@@ -73,8 +73,8 @@ import qualified Distribution.PackageDescription as PkgDesc
73
73
import Distribution.PackageDescription.Configuration
74
74
( finalizePD )
75
75
import Distribution.Version
76
- ( Version , mkVersion , anyVersion , thisVersion
77
- , VersionRange , orLaterVersion )
76
+ ( Version , anyVersion , thisVersion
77
+ , VersionRange )
78
78
import Distribution.Simple.Utils as Utils
79
79
( warn , notice , debug , die'
80
80
, defaultPackageDesc )
@@ -84,21 +84,12 @@ import Distribution.System
84
84
import System.FilePath ( (</>) )
85
85
86
86
-- | Choose the Cabal version such that the setup scripts compiled against this
87
- -- version will support the given command-line flags.
87
+ -- version will support the given command-line flags. Currently, it implements no
88
+ -- specific restrictions and allows any version, unless the second argument is
89
+ -- filled with a 'Version', in which case this version is picked.
88
90
chooseCabalVersion :: ConfigExFlags -> Maybe Version -> VersionRange
89
- chooseCabalVersion configExFlags maybeVersion =
90
- maybe defaultVersionRange thisVersion maybeVersion
91
- where
92
- -- Cabal < 1.19.2 doesn't support '--exact-configuration' which is needed
93
- -- for '--allow-newer' to work.
94
- allowNewer = isRelaxDeps
95
- (maybe mempty unAllowNewer $ configAllowNewer configExFlags)
96
- allowOlder = isRelaxDeps
97
- (maybe mempty unAllowOlder $ configAllowOlder configExFlags)
98
-
99
- defaultVersionRange = if allowOlder || allowNewer
100
- then orLaterVersion (mkVersion [1 ,19 ,2 ])
101
- else anyVersion
91
+ chooseCabalVersion _configExFlags maybeVersion =
92
+ maybe anyVersion thisVersion maybeVersion
102
93
103
94
-- | Configure the package found in the local directory
104
95
configure :: Verbosity
0 commit comments