Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use Cabal to keep Haskell packages up-to-date?

Tags:

haskell

cabal

I'm confused by how Cabal works. I'm used to packages managers that have as part of their core functionality the ability to easily update all packages that have changed, or at least to get a list of packages on my system that have updates available. But Cabal seems to lack this functionality. Am I missing something?

Is there a way to:

  1. Automatically or easily update all out-of-date packages; or, failing that,
  2. Get a list of packages installed on my system that have updates available?
like image 294
orome Avatar asked Aug 18 '15 16:08

orome


1 Answers

There are a number of standard package-management features missing from cabal. This is one of them, and (transitive) removal of packages is another. The party line is that cabal is intended to be an automatic build tool, nothing more; though that line grows thinner and thinner as the years drag on.

If you know which packages you want to upgrade, you can; generally cabal update and cabal install those packages will grab the newest package list from Hackage and try to find an install plan that installs the newest versions of the requested packages. You can ask for the install plan without executing it with cabal install --dry-run those packages; if it doesn't look like it picked the versions you want, you can add constraints, as in

cabal install those packages --constraint 'those>=9000'
like image 101
Daniel Wagner Avatar answered Sep 27 '22 17:09

Daniel Wagner