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
Update lock_api and instant to most recent versions #254
Conversation
lock_api is updated from 0.4.0 to 0.4.1. instant is upsated from 0.1.4 to 0.1.7.
Thanks for maintaining this crate. Some additional context for this change: We're considering parking_lot for use in the Android open source project [1]. For Android, it's important that we limit the number of crate versions that are used because that reduces both memory and disk usage, both of critical importance on resource-constrained Android devices. Generally we try to achieve that by only depending on the latest version of each crate that we directly or indirectly use. This change moves us to the most recent version of lock_api and instant crates. [1] https://android-review.googlesource.com/c/platform/external/rust/crates/parking_lot/+/1460364 |
This should not be necessary, cargo will never select both 0.1.4 and 0.1.7 as incompatible crates were it would compile in both versions. |
I'm not sure I understand what you mean. If project A depends in 0.1.4, and project B depends on version 0.1.7, cargo will pull in 0.1.4 for project A and 0.1.7 for project B. Which would result in two versions of the same dylib on my device. If instead they both depend on 0.1.7, then I can have both projects depend on the same compiled output. |
That's not the case, if both 0.1.4 and 0.1.7 are depended on cargo will only pull in 0.1.7, unless they both specify them as "=0.1.4" and "=0.1.7" respectively. Unless of course these two projects are separate projects (i.e. two different cargo projects with their own Cargo.lock files) and you are linking them together in some custom way. |
Isn't that only true if 0.1.4 and 0.1.7 are depended on by the same project (e.g. a single "cargo build" command)? I'm not just concerned about a single project and its dependencies. I want separate/independent projects to rely on the same version of the crate if possible. Or does cargo always pull in the most recent minor version? |
The |
@j-vanderstoep When you do So yes, the change the PR makes should not be needed. You should just be able to do |
Thanks everyone for the explanation. I confirmed locally exactly what you're describing - Even if 0.1.4 is specified, if 0.1.7 exists, Cargo will use that instead. |
lock_api is updated from 0.4.0 to 0.4.1.
instant is upsated from 0.1.4 to 0.1.7.