Comment by pornel
2 months ago
Cargo.lock contains unused dependencies that aren't in the final product.
That's because it's a:
• union of all deps for all possible target platforms, • for all libraries and all binaries in the whole workspace, • and includes all optional deps for all optional features, regardless whether these features are currently enabled or not.
This means that Cargo.lock truly locks everything, and works for all platforms and configurations of a project. It's stable enough to commit into source control, as it won't get invalidated/mutated just because somebody used it on another OS or built the project with an extra flag.
But it doesn't represent what actually goes into each binary.
No comments yet
Contribute on Hacker News ↗