Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For cabal, what does only-dependencies flag mean?

Tags:

haskell

cabal

I'm fairly new to Haskell, and upon seeing this flag, e.g. in this dockerfile, I can't ever seem to find an explanation for what it does. "Install only the dependencies necessary to build the given packages," in the cabal help install doesn't say much to me.

If I'm not building inside a docker container, I use sandboxes. Is this flag applicable to either of these situations?

like image 559
Bijou Trouvaille Avatar asked May 19 '15 08:05

Bijou Trouvaille


1 Answers

For cabal, what does only-dependencies flag mean?

It can be spelled as both --dependencies-only and --only-dependencies and it simply means that it will install all, and only, the dependencies the specific package requires (without installing or building the packages themselves). Note that by default tests and benchmark dependencies will not be installed; for them you need to add --enable-tests and --enable-benchmarks respectively.

Is this flag applicable to either of these situations?

Yes, this can be used just fine with cabal sandboxes as well as without.

What's then the difference between it and simply running cabal install, which has worked for me so far?

cabal install will install both those dependencies and the packages themselves. Same for cabal build. cabal install --only-dependencies will only install the dependencies those packages require.

like image 99
Shoe Avatar answered Nov 05 '22 01:11

Shoe