Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do "cabal-dev" and "cabal sandbox init" relate to each other?

Tags:

haskell

cabal

It seems that I am missing something. As far as I understand cabal sandbox init says that starting from the current folder and all sub-folders all cabal install commands are scoped to a sandbox. So everything outside this folder is not in a sandbox.

What's the purpose of cabal-dev then? Should I use cabal install or cabal-dev install in a sandbox?

like image 545
Trident D'Gao Avatar asked Nov 02 '13 03:11

Trident D'Gao


1 Answers

TLDR, cabal-dev was an initial solution for sandboxing and cabal sandbox is the fully integrated realization.

Until a few months ago, there was no pleasant way to sandbox builds with cabal. This was a huge problem for any library maintainer or really anyone who might worry about dependency conflicts. To solve this, a few people but together a tool called cabal-dev. It supplemented cabal and added some ability to sandbox.

Now after this existing for a few years, in version 1.18, cabal has gained sandboxes! This means that we can switch from using cabal + cabal-dev to just cabal since cabal has now subsumed cabal-dev.

In addition, because sandboxes are fully integrated into cabal, they play nicely with other cabal features, like cabal repl which is just impossible for cabal-dev.

Finally, recent chatter on the Haskell-Cafe mailing list suggests that cabal-dev is not likely to be maintained much longer so aside from 1-2 current bugs in cabal sandbox there's no reason not to switch.

like image 190
Daniel Gratzer Avatar answered Sep 17 '22 16:09

Daniel Gratzer