Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current State
At the moment users specify registries and repositories in every single dependency declaration. This does not only lead to a chunky
Proto.toml
as we repeat common information way more often that we actually need to, it also has a semantic impact:It allows users to request a dependencies from distributed registries at the same time and it inherently teaches buffrs about the existence of repositories.
E.g.
Context
In the realm of dynamic version resolution we need to rethink this current state: Established version resolution algorithms like pubgrub and resolve are not aware of this situation.
E.g. in the current situation a package
[email protected]
could be present in the repositoryfoo
and[email protected]
could be present in the repositorybaz
. When using the above mentioned version solvers with a request to installa>=1.0
this leads to a quite hard decision problem: Do we want to jump repositories when we know that there is a later stable release present in another one? How do we get to know about the other repository? Is this the desired behavior?Although this setup may seem odd at first glance it is not so far of some real world setups using artifactory where repositories are used to distinguish between stability. E.g. many companies publish prereleases and stable releases into different repositories.
A possible way forward
Some possible ideas to solve this problem are:
Using Named Registries
Using named registries we can move towards a registry based approach and drop our in-manifest knowledge about repositories altogether.
Users could name registries in a configuration file and declare a set of artifactory repositories to search through:
$HOME/.buffrs/config.toml
/$PWD/.buffrs/config.toml
:When installing buffrs would now search the above repositories (using the artifactory search api) to locate possible releases. This would be quite efficient and elegant as this would result in the manifest looking like this:
or (
foo = { version = "=1.0.0" }
). Which is not only much more readable but also leaves us the ability to jump around repositories within the same registry to resolve different versions, thus unifying the version set from being sharded across repositories into one big searchable version set for version resolution. All of this is achieved while stripping out the repository concept from the actual buffrs manifests!One caveat is that we need to still specify the exact repository when publishing, but this can be done via the cli anyway.
Dropping prereleases
See pubgrubs take on prereleases. They introduce a lot of headache when trying to do version resolution correctly and it may be a good tradeoff to drop their support for now in order to ship proper dependency resolution.
I am probably not going to have the time to finish this any time soon, contributions are welcome.