← Back to context

Comment by steveklabnik

10 months ago

Cargo does not do dependency resolution on every build.

how does a dependency management system ensure the dependencies are there without doing dependency resolution?

  • By separating the two. If there’s no Cargo.lock, resolution needs to be done, and the result is written out to the lock file. If the lock file is there, then you don’t need to re-run resolution, you just read out the result from the file.

    The latency you’re arguing over is probably more to do with rustup selecting the right cargo and exec-ing that than dependency resolution. It’s heavier weight than it should be due to history reasons.