Skip to content

Commit

Permalink
Remove legacy command v1-freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka committed Jul 11, 2023
1 parent bd7197b commit c7b82d8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 102 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ bench.html

# Emacs
.projectile

# nix-direnv
.direnv
24 changes: 0 additions & 24 deletions cabal-install/src/Distribution/Client/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import Distribution.Client.Setup
, defaultInstallFlags
, fetchCommand
, formatCommand
, freezeCommand
, genBoundsCommand
, getCommand
, globalCommand
Expand Down Expand Up @@ -137,7 +136,6 @@ import qualified Distribution.Client.CmdUpdate as CmdUpdate
import Distribution.Client.Check as Check (check)
import Distribution.Client.Configure (configure, writeConfigFlags)
import Distribution.Client.Fetch (fetch)
import Distribution.Client.Freeze (freeze)
import Distribution.Client.GenBounds (genBounds)
import Distribution.Client.Install (install)

Expand Down Expand Up @@ -395,7 +393,6 @@ mainWorker args = do
, legacyCmd configureExCommand configureAction
, legacyCmd buildCommand buildAction
, legacyCmd replCommand replAction
, legacyCmd freezeCommand freezeAction
, legacyCmd haddockCommand haddockAction
, legacyCmd installCommand installAction
, legacyCmd runCommand runAction
Expand Down Expand Up @@ -1048,27 +1045,6 @@ fetchAction fetchFlags extraArgs globalFlags = do
fetchFlags
targets

freezeAction :: FreezeFlags -> [String] -> Action
freezeAction freezeFlags _extraArgs globalFlags = do
let verbosity = fromFlag (freezeVerbosity freezeFlags)
config <- loadConfigOrSandboxConfig verbosity globalFlags
distPref <- findSavedDistPref config NoFlag
nixShell verbosity distPref globalFlags config $ do
let configFlags = savedConfigureFlags config
globalFlags' = savedGlobalFlags config `mappend` globalFlags
(comp, platform, progdb) <- configCompilerAux' configFlags

withRepoContext verbosity globalFlags' $ \repoContext ->
freeze
verbosity
(configPackageDB' configFlags)
repoContext
comp
platform
progdb
globalFlags'
freezeFlags

genBoundsAction :: FreezeFlags -> [String] -> GlobalFlags -> IO ()
genBoundsAction freezeFlags _extraArgs globalFlags = do
let verbosity = fromFlag (freezeVerbosity freezeFlags)
Expand Down
78 changes: 0 additions & 78 deletions cabal-install/src/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ module Distribution.Client.Setup
, InfoFlags (..)
, fetchCommand
, FetchFlags (..)
, freezeCommand
, FreezeFlags (..)
, genBoundsCommand
, getCommand
Expand Down Expand Up @@ -409,7 +408,6 @@ globalCommand commands =
, addCmd "v1-run"
, addCmd "v1-test"
, addCmd "v1-bench"
, addCmd "v1-freeze"
, addCmd "v1-haddock"
, addCmd "v1-install"
, addCmd "v1-clean"
Expand Down Expand Up @@ -1430,82 +1428,6 @@ defaultFreezeFlags =
, freezeVerbosity = toFlag normal
}

freezeCommand :: CommandUI FreezeFlags
freezeCommand =
CommandUI
{ commandName = "freeze"
, commandSynopsis = "Freeze dependencies."
, commandDescription = Just $ \_ ->
wrapText $
"Calculates a valid set of dependencies and their exact versions. "
++ "If successful, saves the result to the file `cabal.config`.\n"
++ "\n"
++ "The package versions specified in `cabal.config` will be used for "
++ "any future installs.\n"
++ "\n"
++ "An existing `cabal.config` is ignored and overwritten.\n"
, commandNotes = Nothing
, commandUsage = usageFlags "freeze"
, commandDefaultFlags = defaultFreezeFlags
, commandOptions = \showOrParseArgs ->
[ optionVerbosity
freezeVerbosity
(\v flags -> flags{freezeVerbosity = v})
, option
[]
["dry-run"]
"Do not freeze anything, only print what would be frozen"
freezeDryRun
(\v flags -> flags{freezeDryRun = v})
trueArg
, option
[]
["tests"]
( "freezing of the dependencies of any tests suites "
++ "in the package description file."
)
freezeTests
(\v flags -> flags{freezeTests = v})
(boolOpt [] [])
, option
[]
["benchmarks"]
( "freezing of the dependencies of any benchmarks suites "
++ "in the package description file."
)
freezeBenchmarks
(\v flags -> flags{freezeBenchmarks = v})
(boolOpt [] [])
]
++ optionSolver
freezeSolver
(\v flags -> flags{freezeSolver = v})
: optionSolverFlags
showOrParseArgs
freezeMaxBackjumps
(\v flags -> flags{freezeMaxBackjumps = v})
freezeReorderGoals
(\v flags -> flags{freezeReorderGoals = v})
freezeCountConflicts
(\v flags -> flags{freezeCountConflicts = v})
freezeFineGrainedConflicts
(\v flags -> flags{freezeFineGrainedConflicts = v})
freezeMinimizeConflictSet
(\v flags -> flags{freezeMinimizeConflictSet = v})
freezeIndependentGoals
(\v flags -> flags{freezeIndependentGoals = v})
freezePreferOldest
(\v flags -> flags{freezePreferOldest = v})
freezeShadowPkgs
(\v flags -> flags{freezeShadowPkgs = v})
freezeStrongFlags
(\v flags -> flags{freezeStrongFlags = v})
freezeAllowBootLibInstalls
(\v flags -> flags{freezeAllowBootLibInstalls = v})
freezeOnlyConstrained
(\v flags -> flags{freezeOnlyConstrained = v})
}

-- ------------------------------------------------------------

-- * 'gen-bounds' command
Expand Down

0 comments on commit c7b82d8

Please sign in to comment.