Skip to content

Commit 7b475e8

Browse files
committed
fixup! Add --promised-dependency flag to Cabal ./Setup configure interface
1 parent fbc48ce commit 7b475e8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 7 additions & 2 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 {
@@ -498,8 +500,11 @@ filterConfigureFlags flags cabalLibVersion
498500
}
499501

500502
flags_3_11_0 = flags_latest {
501-
configDependencies = configDependencies flags ++ configPromisedDependencies flags
502-
, configPromisedDependencies = []
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) []
503508
}
504509

505510
flags_3_7_0 = flags_3_11_0 {

doc/setup-commands.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ Miscellaneous options
876876
be installed. This is useful when attempting to start multiple component
877877
sessions with cabal's multi-repl or projects such as Haskell Language Server.
878878

879-
Several checks which are enabled for ``-dependency``s are disabled for promised
879+
Several checks which are enabled for ``--dependency``s are disabled for promised
880880
dependencies, so prefer to use ``--dependency`` if you know that the dependency
881881
is already installed.
882882

0 commit comments

Comments
 (0)