Skip to content

Commit

Permalink
fixup! Add --promised-dependency flag to Cabal ./Setup configure inte…
Browse files Browse the repository at this point in the history
…rface
  • Loading branch information
fgaz committed May 25, 2023
1 parent 9660e7f commit 4e33a89
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions cabal-install/src/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ import Data.List
( deleteFirstsBy )
import System.FilePath
( (</>) )
import Control.Exception
( assert )

globalCommand :: [Command action] -> CommandUI GlobalFlags
globalCommand commands = CommandUI {
Expand Down Expand Up @@ -497,16 +499,13 @@ filterConfigureFlags flags cabalLibVersion
configConstraints = []
}

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

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

0 comments on commit 4e33a89

Please sign in to comment.