Reputation: 15547
I want to point my global cabal config to use stackage LTS only.
Does cabal sandbox provide any value in that case?
As I understand there should be no cabal hell anymore as all projects will use a predetermined set of package that are guaranteed to build together.
Is there any way to prebuild all stackage LTS packages to speed up all future project builds?
Upvotes: 3
Views: 386
Reputation: 346
I think there are still benefits to using sandboxes:
Not every package is in stackage, if you end up using a library or depending on something that is not part of stackage you have no guarantee that it will work with the rest of your packages.
Sandboxes have other uses outside of just preventing cabal hell. Their other main use is to be able to add local directories as sources of packages. For example, lets say you have checked out two packages on your local disk ~/code/a
and ~/code/b
and lets say that b
depends on a
. If you want to check that b
works with some changes you've made to a
you can add your local a
checkout as a source to b
's cabal sandbox.
cd ~/code/b
cabal sandbox add-source ~/code/a
cabal build
If you are set on pre-building all of your packages you can use the following to install all the packages listed in a cabal.config file.
cat cabal.config | sed -rn 's/^.* ([^ ]+) ==.*/\1/gp' | xargs cabal install
Upvotes: 3