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

feat: disable candidates #5

Merged
merged 6 commits into from
Nov 3, 2023
Merged

feat: disable candidates #5

merged 6 commits into from
Nov 3, 2023

Conversation

baszalmstra
Copy link
Contributor

Adds the ability to disable specific candidates within the solver. This can be useful for error reporting.

Previously one would filter out incompatible candidates before passing them to the solver. This has the downside that if the problem is unsolvable the filtering is not transparent to the user. With this change the solver receives the candidates and immediately deselects them. However, they are still present in the error output with a custom message:

The following packages are incompatible
|-- a * cannot be installed because there are no viable options:
    |-- a 1 is disabled because it is externally disabled

The it is externally disabled in this example was injected into the solver.

I think in a next iteration it would be nice to merge some of these problems together to get a more readable output. This is currently a bit verbose if there are many disabled versions.

@baszalmstra baszalmstra added the enhancement New feature or request label Nov 2, 2023
@baszalmstra baszalmstra marked this pull request as draft November 2, 2023 15:43
@baszalmstra baszalmstra marked this pull request as ready for review November 2, 2023 16:10
src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@wolfv wolfv left a comment

Choose a reason for hiding this comment

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

Just a little typo. Looks great to me, excited for this!

src/solver/clause.rs Outdated Show resolved Hide resolved
@tdejager tdejager merged commit 2b786a3 into main Nov 3, 2023
3 checks passed
@wolfv wolfv deleted the feat/disable_candidates branch November 3, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants