Skip to content

Commit

Permalink
Deprecated --solver CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka committed Nov 14, 2023
1 parent 21b858f commit 562dc1d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
15 changes: 12 additions & 3 deletions cabal-install/src/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ import System.FilePath
( (</>)
)

import System.IO (hPutStrLn, stderr)
import System.IO.Unsafe (unsafePerformIO)

globalCommand :: [Command action] -> CommandUI GlobalFlags
globalCommand commands =
CommandUI
Expand Down Expand Up @@ -843,7 +846,7 @@ data ConfigExFlags = ConfigExFlags
deriving (Eq, Show, Generic)

defaultConfigExFlags :: ConfigExFlags
defaultConfigExFlags = mempty{configSolver = Flag defaultSolver}
defaultConfigExFlags = mempty

configureExCommand :: CommandUI (ConfigFlags, ConfigExFlags)
configureExCommand =
Expand Down Expand Up @@ -928,7 +931,13 @@ configureExOptions _showOrParseArgs src =
)
(map prettyShow)
)
, optionSolver configSolver (\v flags -> flags{configSolver = v})
, optionSolver
configSolver
( \_ flags ->
unsafePerformIO $ do
hPutStrLn stderr "[WARNING] The --solver flag is deprecated and will be removed in a future release."
return flags
)
, option
[]
["allow-older"]
Expand Down Expand Up @@ -3422,7 +3431,7 @@ optionSolver get set =
option
[]
["solver"]
("Select dependency solver to use (default: " ++ prettyShow defaultSolver ++ "). Choices: " ++ allSolvers ++ ".")
("[DEPRECATED] Select dependency solver to use (default: " ++ prettyShow defaultSolver ++ "). Choices: " ++ allSolvers ++ ".")
get
set
( reqArg
Expand Down
2 changes: 1 addition & 1 deletion doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ builds with ``cabal build`` are performed with the compiler

- Any flag accepted by ``cabal configure`` beyond
``./Setup configure``, namely ``--cabal-lib-version``,
``--constraint``, ``--preference`` and ``--solver.``
``--constraint`` and ``--preference``.

- Any flag accepted by ``cabal install`` beyond ``./Setup configure``.

Expand Down
4 changes: 4 additions & 0 deletions doc/cabal-project-description-file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,10 @@ Most users generally won't need these.

The command line variant of this field is ``--solver=modular``.

.. warning::

This CLI option has been deprecated and will be removed in a future release.

.. cfg-field:: max-backjumps: nat
--max-backjumps=N
:synopsis: Maximum number of solver backjumps.
Expand Down

0 comments on commit 562dc1d

Please sign in to comment.