You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Offer install flag: do not download dependencies #2566
There are times where we would like to prevent cabal-install from downloading dependencies, such as when bandwidth is limited or when using an external tool to download tarballs. It would be good to have a flag to the install command (strawman: --no-download) to prevent it from trying to perform downloads.
I actually implemented this some time ago because I (thought that I) needed it for sandboxes. The sandbox issue was solved in a different way, so the offline mode patch wasn't merged. Should be easy to resurrect it.
My patch is a bit simplistic, though: it works by rejecting install plans that contain non-local packages. This could be also implemented by modifying the solver to not consider such packages.
Btw, I've been wanting a related feature that allows to limit the solver to only consider an explicitly specified set of additional dependencies for computing the install-plan. Right now I have to repeatedly call cabal install --dry and find out if the solver picked up any additional build-dep I didn't allow/specify, and add a respective --constraint flag, and repeat this process until a fixpoint is reached.
@hvr Could you open a separate ticket for that request? As I see it, @snoyberg's request doesn't affect the solver at all. Your request would, but the feature should be extremely easy to add, modulo bikeshedding about the name and syntax of the flag.
Ah, sorry, I've not read the discussion in detail. Ok, a solution affecting the solver for the original change has also been discussed, even though that's not how I originally understood the request. I'm open to add solver-changing flags for this (in particular as this is only about adding additional preferences, which is very easy to do), if that's what people would prefer.
Activity
23Skidoo commentedon Apr 29, 2015
I actually implemented this some time ago because I (thought that I) needed it for sandboxes. The sandbox issue was solved in a different way, so the offline mode patch wasn't merged. Should be easy to resurrect it.
23Skidoo commentedon Apr 29, 2015
My patch is a bit simplistic, though: it works by rejecting install plans that contain non-local packages. This could be also implemented by modifying the solver to not consider such packages.
snoyberg commentedon Apr 29, 2015
For my specific use case, failing would be acceptable, though I can certainly imagine other use cases that would have different requirements.
snoyberg commentedon Apr 29, 2015
(And thanks for the quick reply!)
kosmikus commentedon Apr 29, 2015
I would like this too.
hvr commentedon Apr 29, 2015
Btw, I've been wanting a related feature that allows to limit the solver to only consider an explicitly specified set of additional dependencies for computing the install-plan. Right now I have to repeatedly call
cabal install --dryand find out if the solver picked up any additional build-dep I didn't allow/specify, and add a respective--constraintflag, and repeat this process until a fixpoint is reached.kosmikus commentedon Apr 29, 2015
@hvr Could you open a separate ticket for that request? As I see it, @snoyberg's request doesn't affect the solver at all. Your request would, but the feature should be extremely easy to add, modulo bikeshedding about the name and syntax of the flag.
kosmikus commentedon Apr 29, 2015
Ah, sorry, I've not read the discussion in detail. Ok, a solution affecting the solver for the original change has also been discussed, even though that's not how I originally understood the request. I'm open to add solver-changing flags for this (in particular as this is only about adding additional preferences, which is very easy to do), if that's what people would prefer.
Implement offline mode for the 'install' command.
Implement offline mode for the 'install' command.