Skip to content

cargo build tries to download packages #2229

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

Closed
engstad opened this issue Dec 18, 2015 · 7 comments
Closed

cargo build tries to download packages #2229

engstad opened this issue Dec 18, 2015 · 7 comments

Comments

@engstad
Copy link

engstad commented Dec 18, 2015

When issuing

cargo build

It will install packages from the internet. From my very slow internet connection, that is no good.

@steveklabnik
Copy link
Member

If you have dependencies, this is expected behavior, yes. Otherwise, how would you get them?

If you've already downloaded said dependencies, though, it should not.

@alexcrichton
Copy link
Member

Yeah as @steveklabnik mentioned this is expected behavior because the dependencies need to come from somewhere, so I'm going to close this as working as intended.

@engstad
Copy link
Author

engstad commented Dec 18, 2015

Perhaps I wasn't clear? I asked cargo to build not to download. If it needs to download, I expect that to be another command. If the command auto-downloads, it should be reflected in the command. Even better would be if there was some kind of configuration saying "I don't want to download automatically". If download is needed, it will instead error, saying something like:

cargo needs to download package xxxx-0.3, if this was intended pass --allow-download to cargo build

@alexcrichton
Copy link
Member

Ah yeah there are a number of other issues in the repo about intentionally telling Cargo to not touch the network, such as #2111

@engstad
Copy link
Author

engstad commented Dec 18, 2015

I think the way that git does it is quite good. There is an explicit command to download (and sync) anything. I feel that cargo does too much with the commands. For instance, I might not care that the up-streams have released new versions - why then should cargo check for it?

@steveklabnik
Copy link
Member

For instance, I might not care that the up-streams have released new versions - why then should cargo check for it?

It doesn't. I think you may be conflating a few different behaviors here.

If you don't have the requirements to build, cargo build will go get them. Yes, in theory, we could make it two commands, but that introduces friction for the majority case at the expense of the minority case.

If you do have the requirements, then it shouldn't check the network. There may be bugs, and they should be fixed.

@engstad
Copy link
Author

engstad commented Dec 18, 2015

Yes, I may have been bitten by previous bugs. I just remember the network being off-line, I had all the files in the registry already, yet still I couldn't build because cargo tried to sync to the latest. I'll check it again.

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

No branches or pull requests

3 participants