-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo package
downloads dev dependencies
#2394
Comments
For anyone who wishes to tackle this, the problem here looks like this:
The bug here is that we download everything regardless of whether we'll ever need it later on or not. The fundamental problem is that the filtering of what packages we really need happens as part of the backend in Possible solutions include:
|
Currently Cargo will download an entire resolution graph all at once when in fact most packages may not be relevant to a compilation. For example target-specific dependencies and dev-dependencies are unconditionally downloaded regardless of whether they're actually needed or not. This commit alters the internals of Cargo to avoid downloading everything immediately and just switches to lazily downloading packages. This involved adding a new `LazyCell` primitive (similar to the one in use on crates.io) and also propagates `CargoResult` in a few more locations. Overall this ended up being a pretty large refactoring so the commits are separated in bite-sized chunks as much as possible with the end goal being this PR itself. Closes #2394
When traveling, or when I have spotty internet connectivity, I want to be able to download all the packages so I have them offline, so I don't need internet connectivity. The all-upfront approach works better for this. So, it would be nice to continue, at least, to have some way of downloading all the dependent packages upfront ( |
@briansmith |
https://ci.appveyor.com/project/retep998/winapi-rs/build/1.0.717/job/h7ohqxbk9vjtrb7p
There's no need for it to be downloading those dev dependencies when doing
cargo package
.The text was updated successfully, but these errors were encountered: