Skip to content

Commit 4e33a89

Browse files
committed
fixup! Add --promised-dependency flag to Cabal ./Setup configure interface
1 parent 9660e7f commit 4e33a89

File tree

1 file changed

+9
-10
lines changed
  • cabal-install/src/Distribution/Client

1 file changed

+9
-10
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ import Data.List
134134
( deleteFirstsBy )
135135
import System.FilePath
136136
( (</>) )
137+
import Control.Exception
138+
( assert )
137139

138140
globalCommand :: [Command action] -> CommandUI GlobalFlags
139141
globalCommand commands = CommandUI {
@@ -497,16 +499,13 @@ filterConfigureFlags flags cabalLibVersion
497499
configConstraints = []
498500
}
499501

500-
flags_3_11_0 = if not . null $ configPromisedDependencies flags then error $
501-
"--promised-dependencies was requested, likely through --enable-multi-repl,\n\
502-
\but some package setup-depends on Cabal " ++ prettyShow cabalLibVersion ++ ",\n\
503-
\which is too old to support --promised-dependencies. Use the flag\n\
504-
\--constraint='setup.Cabal >= 3.11' to constrain Cabal to an appropriate\n\
505-
\version or to see which package is requiring an older version.\n\
506-
\TODO: automate the constraint, see https://github.com/haskell/cabal/issues/8954"
507-
else flags_latest {
508-
configPromisedDependencies = []
509-
}
502+
flags_3_11_0 = flags_latest {
503+
-- It's too late to convert configPromisedDependencies to anything
504+
-- meaningful, so we just assert that it's empty.
505+
-- We add a Cabal>=3.11 constraint before solving when multi-repl is
506+
-- enabled, so this should never trigger.
507+
configPromisedDependencies = assert (null $ configPromisedDependencies flags) []
508+
}
510509

511510
flags_3_7_0 = flags_3_11_0 {
512511
-- Cabal < 3.7 does not know about --extra-lib-dirs-static

0 commit comments

Comments
 (0)