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

Fix solve dance caused by verification tasks #302

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading