The commands install
, v1-install
, v2-install
and new-install
are simply described to "Install packages" when running man cabal
. Are they different from one another? Which is the preferred option?
What is the difference between install, v1-install, v2-install and new-install?
Asked Answered
For modern versions of cabal-install, install
, new-install
and v2-install
are the same. v1-install
and the other v1-
commands are obsolete and should not be used anymore.
Notice that, when developing a cabal package, the install
command is largely unnecessary. Running cabal build
and cabal repl
will automatically install the required dependencies (listed in the build-depends:
section of the cabal file).
cabal install
is still useful in cases like the following:
- Installing an executable from a package. Like the
warp
executable from the package wai-app-static. In those cases, the options--overwrite-policy
,--install-method
and--installdir
are useful. - Creating a local package environment in some folder, so that "bare" invocations of
ghc
andghci
see some desired set of libraries. Like this. In those cases, the options--lib
and--package-env
are useful.
The fact that completely different sets of options are relevant for different cases suggests that the command should be split into two: one for installing executables, and another for creating package environments. –
Hypercatalectic
© 2022 - 2024 — McMap. All rights reserved.