Skip to content

Commit

Permalink
Fix solve dance caused by verification tasks (#302)
Browse files Browse the repository at this point in the history
* remove verification tasks

* add news

* pre-commit
  • Loading branch information
jaimergp authored Sep 28, 2023
1 parent 0a5e1d6 commit 2d218ab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
7 changes: 1 addition & 6 deletions conda_libmamba_solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,23 +523,18 @@ def _specs_to_tasks_add(self, in_state: SolverInputState, out_state: SolverOutpu
else:
# we freeze everything else as installed
lock = in_state.update_modifier.FREEZE_INSTALLED
verify = True
if pinned and pinned.is_name_only_spec:
# name-only pins are treated as locks when installed
lock = True
if python_version_might_change and installed.noarch is None:
for dep in installed.depends:
if MatchSpec(dep).name in ("python", "python_abi"):
lock = verify = False
lock = False
break
if lock:
tasks[("LOCK", api.SOLVER_LOCK | api.SOLVER_WEAK)].append(
installed_spec_str
)
if verify:
# without verify, solves after a force-remove do not restore missing pkg
# see conda/tests/core/test_solve.py::test_force_remove_1
tasks[("VERIFY", api.SOLVER_VERIFY | api.SOLVER_WEAK)].append(name)

return dict(tasks)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
# classic expects implicit update to channel with higher priority, including downgrades
# libmamba does not do this, it just stays in the same channel; should it change?
"test_priority_1",
# FIXME: Known issue: We can use a VERIFY task, but that causes a "dance" across solves,
# where the verification task changes a few specs. Next time it runs it undoes it.
"test_force_remove_1",
# The following are known to fail upstream due to too strict expectations
# We provide the same tests with adjusted checks in tests/test_modified_upstream.py
"test_pinned_1",
Expand Down
19 changes: 19 additions & 0 deletions news/302-solve-dance
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Prevent solver from bouncing between two compatible solutions when the same command is run twice in a row. (#302)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>

0 comments on commit 2d218ab

Please sign in to comment.