From 11a5dd2a8c7e0f83c367f71ebc2c15c9c4fbeb47 Mon Sep 17 00:00:00 2001 From: Artem Pelenitsyn Date: Mon, 6 Jun 2022 09:42:31 -0400 Subject: [PATCH] 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. --- .../src/Distribution/Client/Configure.hs | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/cabal-install/src/Distribution/Client/Configure.hs b/cabal-install/src/Distribution/Client/Configure.hs index d0fd92e7db5..ffff19d76fc 100644 --- a/cabal-install/src/Distribution/Client/Configure.hs +++ b/cabal-install/src/Distribution/Client/Configure.hs @@ -73,8 +73,8 @@ import qualified Distribution.PackageDescription as PkgDesc import Distribution.PackageDescription.Configuration ( finalizePD ) import Distribution.Version - ( Version, mkVersion, anyVersion, thisVersion - , VersionRange, orLaterVersion ) + ( Version, anyVersion, thisVersion + , VersionRange ) import Distribution.Simple.Utils as Utils ( warn, notice, debug, die' , defaultPackageDesc ) @@ -84,21 +84,12 @@ import Distribution.System import System.FilePath ( () ) -- | Choose the Cabal version such that the setup scripts compiled against this --- version will support the given command-line flags. +-- version will support the given command-line flags. Currently, it implements no +-- specific restrictions and allows any version, unless the second argument is +-- filled with a `Version`, in which case this version is picked. chooseCabalVersion :: ConfigExFlags -> Maybe Version -> VersionRange -chooseCabalVersion configExFlags maybeVersion = - maybe defaultVersionRange thisVersion maybeVersion - where - -- Cabal < 1.19.2 doesn't support '--exact-configuration' which is needed - -- for '--allow-newer' to work. - allowNewer = isRelaxDeps - (maybe mempty unAllowNewer $ configAllowNewer configExFlags) - allowOlder = isRelaxDeps - (maybe mempty unAllowOlder $ configAllowOlder configExFlags) - - defaultVersionRange = if allowOlder || allowNewer - then orLaterVersion (mkVersion [1,19,2]) - else anyVersion +chooseCabalVersion _configExFlags maybeVersion = + maybe anyVersion thisVersion maybeVersion -- | Configure the package found in the local directory configure :: Verbosity