Skip to content

Commit 2836225

Browse files
ulysses4evermergify[bot]
authored andcommitted
Remove Cabal version check that applied to already not supported <1.19.2 (close #2023)
We used to check that, under presence of --allow-newer/older, Cabal version is >=1.19.2 (earlier versions don't get these flags), but we no longer support <.1.19.2 anyway, so the check is not needed. Remove.
1 parent f9966ee commit 2836225

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

cabal-install/src/Distribution/Client/Configure.hs

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ import qualified Distribution.PackageDescription as PkgDesc
7373
import Distribution.PackageDescription.Configuration
7474
( finalizePD )
7575
import Distribution.Version
76-
( Version, mkVersion, anyVersion, thisVersion
77-
, VersionRange, orLaterVersion )
76+
( Version, anyVersion, thisVersion
77+
, VersionRange )
7878
import Distribution.Simple.Utils as Utils
7979
( warn, notice, debug, die'
8080
, defaultPackageDesc )
@@ -84,21 +84,12 @@ import Distribution.System
8484
import System.FilePath ( (</>) )
8585

8686
-- | 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.
8890
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
10293

10394
-- | Configure the package found in the local directory
10495
configure :: Verbosity

0 commit comments

Comments
 (0)