helsing-ai / buffrs

Modern protobuf package management
https://crates.io/crates/buffrs
Apache License 2.0
213 stars 12 forks source link

Allow dependencies in `Proto.lock` to be updated when manifest changes #257

Closed fredrb closed 3 months ago

fredrb commented 4 months ago

This PR allows buffrs install to make changes to the lockfile when proto dependency versions were upgraded in the manifest.

This code change is sufficient now because buffrs only support pinned versions in the manifest, so we can rely on the manifest always having the desired version. However, whenever we start supporting semantic version upgrades this logic might need to change.

How I validated that my change works

Open Item

I wasn't able to load contents from cache in case we are ignoring the locked dependency and downloading a new version because Cache receives a FileRequirement which can be created from LockedPackage but can't be created from Package. I assume this could be fixed with impl From<Package> for FileRequirement { ... }.

mara-schulke commented 4 months ago

It would be great if we could write a snapshot test for this but im happy to get this merged! Its a big QoL improvement 😊

mara-schulke commented 3 months ago

Thank you!