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

opam-0install-cudf: Add support for the avoid-version flag #35

Closed
wants to merge 1 commit into from

Conversation

kit-ty-kate
Copy link
Collaborator

This PR fixes #23 by calling the solver a second time with a new universe if the solution contains packages flagged with avoid-version. This universe contains all the packages without non-already installed packages flagged with avoid-version.
If the solver suceeds to get a solution without any avoid-version flagged packages then we take that, otherwise we revert to the first solution.

Copy link
Collaborator

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a unit-test for this (see e.g. https://github.com/ocaml-opam/opam-0install-solver/tree/master/test/diagnostics).

Should the non-cudf solver get the same update?

let solve context pkgs =
let req = requirements ~context pkgs in
match Solver.do_solve ~closest_match:false req with
| Some sels -> Ok sels
| Some sels ->
if selection_contains_new_avoid_versions context sels then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test looks backwards to me.

@kit-ty-kate
Copy link
Collaborator Author

Superseded by #37

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

Successfully merging this pull request may close these issues.

opam-0install: opam 2.1 support
2 participants