Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Cabal 'world' file for?

What is the role of the ~/.cabal/world file, and what do its contents mean? I can't find any documentation and am confused by what I see there.

For example, it corresponds to nether the packages in my user database nor my global packages database, and while it seems to list only (a few of) the packages in my user database, it lists some that I've "removed" with ghc-pkg unregister.

like image 264
orome Avatar asked Oct 04 '15 14:10

orome


1 Answers

As far as I'm aware, it's automatically populated with any package you ever explicitly requested (thus including failed installs). This means that if you copy it to another machine, you can do

cabal install world 

to aim at replicating your current setup.

Of course, you can deregister a package behind cabal's back, and it won't know to delete it from your world file.

(Dependencies will be installed too, but I should emphasise that hackage will have moved on in the meanwhile, and that if you want reproducible installation, it's probably easier to use the stack tool, which has that as one of its principal design goals.)

like image 160
AndrewC Avatar answered Oct 24 '22 13:10

AndrewC