Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer install flag: do not download dependencies #2566

Closed
snoyberg opened this issue Apr 29, 2015 · 8 comments · Fixed by #2578
Closed

Offer install flag: do not download dependencies #2566

snoyberg opened this issue Apr 29, 2015 · 8 comments · Fixed by #2578

Comments

@snoyberg
Copy link
Collaborator

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.

@23Skidoo
Copy link
Member

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
Copy link
Member

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
Copy link
Collaborator Author

For my specific use case, failing would be acceptable, though I can certainly imagine other use cases that would have different requirements.

@snoyberg
Copy link
Collaborator Author

(And thanks for the quick reply!)

@kosmikus
Copy link
Contributor

I would like this too.

@hvr
Copy link
Member

hvr commented 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 --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.

@ttuegel ttuegel added this to the cabal-install-1.24 milestone Apr 29, 2015
@kosmikus
Copy link
Contributor

@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
Copy link
Contributor

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.

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue May 5, 2015
When in offline mode, 'cabal install' only installs packages from the local
tarball cache. Offline mode can be enabled with the '--offline' flag.

Fixes haskell#2566.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue May 5, 2015
When in offline mode, 'cabal install' only installs packages from the local
tarball cache. Offline mode can be enabled with the '--offline' flag.

Fixes haskell#2566.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants