Mic92 / nix-update

Swiss-knife for updating nix packages.
MIT License
504 stars 46 forks source link

`Cargo.lock` not removed if git dependencies has been removed #197

Open pbsds opened 1 year ago

pbsds commented 1 year ago

While making this pr i noticed nix-update update the vendored lock file, instead of removing it.

Mic92 commented 1 year ago

Not sure we should "fix" this. We are not able to tell if it was changed to cargoHash and than deleting some random Cargo.lock might actually upset the user.

Mic92 commented 1 year ago

We would need to evaluate before and see if there had been cargoLock attributes and only drop it in that case.

pbsds commented 1 year ago

Is there a reason to prefer cargoLock over cargoHash? Cache reuse?

Artturin commented 1 year ago

Is there a reason to prefer cargoLock over cargoHash? Cache reuse?

Only if the lock has git dependencies in which case outputHashes is required

pbsds commented 1 year ago

There is also the fact that with cargoLock each dep becomes a derivation, making for better cache reuse. But on the whole I'd say its speed and cache benefits are not worth vendoring lock files, and it's not like we make use of the multiple derivations in any other way.