--only-depencies saves time?

I’ve read the Simple Guide to Cabal at http://katychuang.com/cabal-guide/ http://katychuang.com/cabal-guide/ It says: create a copy of a package by running the command cabal install Some flags can speed up this process --only-dependencies -jN to build N packages in parallel --dry-run to see what cabal plans to do (recommended) But here’s the thing (piping a word count from —dry-run) $ cabal install hakyll --dry-run | wc -l 97 cabal install hakyll --only-dependencies --dry-run | wc -l 96 So it takes 20+ minutes to install a package that you just want to check out for a few minutes, while your CPU melts down in the process? I must be missing something here…? Thanks again for your newbie support, greatly appreciated. P.J.

Best way to avoid this problem in my experience is to use something that'll
cache dependencies so that you're building as few new packages as possible
when checking something out. Historically people have used their user
package-dbs or sandboxes (just package-dbs you put in a place), but there's
nothing done to ensure versions won't start conflicting as the arrow of
time plunges forward.
To that end, I think Stack[1] is pretty useful as you can pick a default
(global to you) user snapshot and everything the snapshot covers will have
a set of versions that work with everything else. This doesn't cover
absolutely everything on Hackage but it should save a lot of build time if
you're going on a library perambulation.
There's no reason, in principle, that you couldn't accomplish the same with
careful tending of a package-db yourself, but in practice nobody knows or
cares to know how anything works so its best to just give them something
they can outsource their executive functions to WRT package versioning.
[1]: https://github.com/commercialhaskell/stack
On Sat, Aug 1, 2015 at 9:19 PM, Peder Jakobsen
I’ve read the Simple Guide to Cabal at http://katychuang.com/cabal-guide/
It says:
create a copy of a package by running the command cabal install Some flags can speed up this process --only-dependencies -jN to build N packages in parallel --dry-run to see what cabal plans to do (recommended)
But here’s the thing (piping a word count from —dry-run)
$ cabal install hakyll --dry-run | wc -l 97 cabal install hakyll --only-dependencies --dry-run | wc -l 96
So it takes 20+ minutes to install a package that you just want to check out for a few minutes, while your CPU melts down in the process? I must be missing something here…?
Thanks again for your newbie support, greatly appreciated.
P.J.
_______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/cabal-devel
-- Chris Allen Currently working on http://haskellbook.com

Hello, Peder, On 2015-Aug-01, Peder Jakobsen wrote:
I’ve read the Simple Guide to Cabal at http://katychuang.com/cabal-guide/ http://katychuang.com/cabal-guide/
The page you are referring to does not explain the flags that it recommends.
It says:
create a copy of a package by running the command cabal install Some flags can speed up this process --only-dependencies
Would install all the dependencies of hakyll, but not hakyll itself. Not much of a time saver, in this case, since there are 96 packages on which hackyll depends. I don't really see much point in this option.
-jN to build N packages in parallel
I have four cores, so I routinely use -j4. It could speed up the build by not more than 400% in that case. Generally, for a build like this, it makes good use (> 90%) of all my CPUs, until towards the end when there are < 4 packages remaining.
--dry-run to see what cabal plans to do (recommended)
This one might save time, because it doesn't install anything; it just prints out what cabal would install. Could be useful in case you want to scan through the list, and if you see anything that you don't want, or it's just too long, decide not to install hakyll, for example. (Could actually waste more of your time, in case you decide to build the package anyway.) I think maybe this is more useful when _not_ using a sandbox, because you could see if the packages it would install would conflict with some that you already have installed?
But here’s the thing (piping a word count from —dry-run)
$ cabal install hakyll --dry-run | wc -l 97 cabal install hakyll --only-dependencies --dry-run | wc -l 96
So it takes 20+ minutes to install a package that you just want to check out for a few minutes, while your CPU melts down in the process? I must be missing something here…?
The hakyll package is interesting and complex, and I don't see much point in checking it out for just "a few minutes" :-) In my case, `time cabal install -j4 hakyll` (in a sandbox) reports that it took 13 minutes and 38 seconds. But this is not too uncommon for installing software from source, whether it's Haskell + cabal or C + `make configure; make; make install` , is it, even if we have binaries for most of the C libraries already installed?
Thanks again for your newbie support, greatly appreciated.
P.J.
Thanks for asking a question that was easy enough for me to answer -- it's something that doesn't happen often on this list ;-)
_______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/cabal-devel
-- Gregory D. Weber, Ph. D. http://pages.iu.edu/~gdweber/ Associate Professor of Informatics Tel (765) 973-8420 Indiana University East FAX (765) 973-8550
participants (3)
-
Christopher Allen
-
gdweber@iue.edu
-
Peder Jakobsen