3 ms·
You're misreading your parent. The download only happens for the first build using a new dependency. As they mention, once the version is written into the Cargo
by dbaupp 8y ago
You're misreading your parent. The download only happens for the first build using a new dependency. As they mention, once the version is written into the Cargo.lock file, that is the exact version that is used until there is an explicit update step run.
- tedunangst 8y agoWhat does "if there is a new version" mean then? If it's a new dependency, there's no old version.
- atoav 8y agoSorry, english is not my first language, I meant this: When you build initially the used dependencies get downloaded. Only if you [A] update, [B] add a new dependency or [C] clean your project and build it again there will be new things downloaded. If you update the versions in your Cargo.lock are ignored and updated if the build is sucessful. If you add a dependency only that depndency is downloaded, the rest is kept as you had it. If you clean it is as if you cloned that project fresh with git and you will have to download all dependencies. If there is a lockfile the exact versions from it will be used. To me this is extremely flexible and works very well AND you get precise control over versions if you want it. By the way it is also possible to clone all dependencies and keep a local copy of them, so you are really 100% sure that nothing could ever change with them. Although I am quite sure crates.io doesn't allow changes without version number change, which means you should be save as long as you rely on the version number.
- dbaupp 8y agoYes, I suppose that's rather misleading, and that sentence contradicts with the actual behaviour that described later in the original comment. For a fixed set of dependencies, versions are only checked and changed on an explicit 'cargo update' run.