3 ms·
If two different dependencies use a different version of some other dependency between them does cargo still include both versions by default? This is somethin
by timewizard 1y ago
If two different dependencies use a different version of some other dependency between them does cargo still include both versions by default?
This is something I've only ever seen cargo do.
- metaltyphoon 1y ago> If two different dependencies use a different version of some other dependency between them does cargo still include both versions by default? No, cargo will resolve using sem ver compatibility and pick the best version. Nuget, for C# does something very similar.
- rcxdude 1y agoIt'll do that if there isn't a single version that meets both requirements. Which is a great thing, because most other languages will just fail the build in that case (well, there are still cases where it won't even work in rust, if types from those sub-dependencies are passed in between the two closer dependencies)
- pas 1y ago> This is something I've only ever seen cargo do. npm does this (which causes [caused?] the node_modules directory to have a megazillion of files usually, but sometimes "hoisting" common dependencies helps, and there's Yarn's PnP [which hooks into Node's require() and keeps packages as ZIPs], and pnpm uses symlinks/hardlinks)