From 2d218abcd8af86a9b5edd327d5a6007d04854aac Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 28 Sep 2023 20:01:14 +0200 Subject: [PATCH] Fix solve dance caused by verification tasks (#302) * remove verification tasks * add news * pre-commit --- conda_libmamba_solver/solver.py | 7 +------ .../collect_upstream_conda_tests.py | 3 +++ news/302-solve-dance | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 news/302-solve-dance diff --git a/conda_libmamba_solver/solver.py b/conda_libmamba_solver/solver.py index eda9845d..c9f5b069 100644 --- a/conda_libmamba_solver/solver.py +++ b/conda_libmamba_solver/solver.py @@ -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) diff --git a/dev/collect_upstream_conda_tests/collect_upstream_conda_tests.py b/dev/collect_upstream_conda_tests/collect_upstream_conda_tests.py index 6062139a..78f2d5ba 100644 --- a/dev/collect_upstream_conda_tests/collect_upstream_conda_tests.py +++ b/dev/collect_upstream_conda_tests/collect_upstream_conda_tests.py @@ -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", diff --git a/news/302-solve-dance b/news/302-solve-dance new file mode 100644 index 00000000..f544b6d3 --- /dev/null +++ b/news/302-solve-dance @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Prevent solver from bouncing between two compatible solutions when the same command is run twice in a row. (#302) + +### Deprecations + +* + +### Docs + +* + +### Other + +*