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(solver)!: Solve for optional solvables in addition to the root solvable #54

Merged
merged 8 commits into from
Aug 6, 2024

Conversation

eviltak
Copy link
Contributor

@eviltak eviltak commented Jul 15, 2024

Adds a new Solver::solve_with_additional method, that solves for the provided root_requirements and root_constraints, along with a set of additional (optional) solvables. Unless the corresponding package has been requested by a version set in another solvable's clauses, each additional solvable is not subject to the package-level clauses introduced in DependencyProvider::get_candidates since the solvables have been requested specifically (and not through a version set).

This feature is useful for situations where you want to ensure that particular solvables (for example, previously installed solvables) are compatible with the solution to the root requirements and constraints.

The implementation is facilitated by making the run_sat method solve for arbitrary solvables at arbitrary levels, not just the root solvable. This allows the solver to solve for the additional solvables after solving for the root solvable while taking into account the clauses and decisions introduced in the solving process.

Breaking changes

  • Renames the problem module and its container structs to conflict, since they are used to inspect an unsatisfiable conflict
  • Uses the newly added solver::Problem struct as an input for the Solver::solve method to allow for flexibility in solver input arguments

Existing users will have to change the code that calls Solver::solve to pass in an instance of the Problem struct rather than passing in the root_requirements and root_constraints directly as arguments to the method.

@eviltak eviltak force-pushed the solve-for-optional-solvables branch from fabe12e to 5f2e596 Compare July 15, 2024 17:52
@eviltak eviltak force-pushed the solve-for-optional-solvables branch from 42beae0 to adc770e Compare July 23, 2024 23:06
@baszalmstra
Copy link
Contributor

Sorry, Im a bit busy with other things atm! Will get back to this PR as soon as I can.

src/solver/mod.rs Outdated Show resolved Hide resolved
src/solver/mod.rs Show resolved Hide resolved
@eviltak eviltak force-pushed the solve-for-optional-solvables branch from adc770e to 97f69da Compare July 31, 2024 14:49
@eviltak eviltak changed the title feat(solver): Solve for optional solvables in addition to the root solvable feat(solver)!: Solve for optional solvables in addition to the root solvable Aug 3, 2024
@eviltak eviltak force-pushed the solve-for-optional-solvables branch from 9d8d069 to e46328a Compare August 3, 2024 15:58
@eviltak eviltak requested a review from baszalmstra August 3, 2024 15:58
Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Merging your other PR has yielded a number of conflicts here. Would you be able to resolve those? Ill merge right after! 👍

@eviltak
Copy link
Contributor Author

eviltak commented Aug 5, 2024

I'll do this in the next few hours, so it should be ready for you to merge tomorrow. Thanks for your help!

@eviltak eviltak force-pushed the solve-for-optional-solvables branch 2 times, most recently from 9de74c9 to f3f886d Compare August 6, 2024 00:55
@eviltak
Copy link
Contributor Author

eviltak commented Aug 6, 2024

Rebased onto main with all conflicts fixed.

@baszalmstra
Copy link
Contributor

Thank you!

@baszalmstra baszalmstra merged commit 0c77ba3 into mamba-org:main Aug 6, 2024
13 checks passed
@baszalmstra baszalmstra mentioned this pull request Aug 5, 2024
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.

2 participants