Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter dependency resolver #1

Closed
ysbaddaden opened this issue May 24, 2015 · 1 comment · Fixed by #259
Closed

Smarter dependency resolver #1

ysbaddaden opened this issue May 24, 2015 · 1 comment · Fixed by #259
Milestone

Comments

@ysbaddaden
Copy link
Contributor

The current dependency resolver is dumb.

It takes the current project shard.yml then clones dependencies, extracts the available versions and takes the shard.yml for the latest version matching the requirement (or HEAD).

It then does the same for the dependencies of each dependency, pushing new dependencies or requirements to a flat list of packages, and so on, recursively.

If any package in the flattened list packages and requirements can't eventually be resolved to at least one version, the resolver will fail by raising a conflict.

This resolver should work for quite some time, until Crystal starts having lots of libraries with lots of dependencies, in which case it will quickly fail.

A smarter resolver will then be appreciable.

@ysbaddaden
Copy link
Contributor Author

I found some reference on this topic: this is a Boolean Satisfiability Problem which is NP-complete (proof) and can be solved with a SAT solver.

There are some libraries available:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants