diff --git a/conda_libmamba_solver/solver.py b/conda_libmamba_solver/solver.py index 37b1f460..ad629017 100644 --- a/conda_libmamba_solver/solver.py +++ b/conda_libmamba_solver/solver.py @@ -282,7 +282,7 @@ def _max_attempts(self, in_state: SolverInputState, default: int = 1): return installed_count else: return max_attempts_from_env - elif in_state.update_modifier.FREEZE_INSTALLED: + elif in_state.update_modifier.FREEZE_INSTALLED and installed_count: # this the default, but can be overriden with --update-specs # we cap at MAX_SOLVER_ATTEMPTS_CAP attempts to avoid things # getting too slow in large environments @@ -314,6 +314,7 @@ def _solving_loop( for_history=dict(out_state.for_history), neutered=dict(out_state.neutered), conflicts=dict(out_state.conflicts), + pins=dict(out_state.pins), ) if not solved: log.debug("Last attempt: reporting all installed as conflicts") @@ -335,7 +336,7 @@ def _solving_loop( self._command = "last_solve_attempt" else: self._command += "+last_solve_attempt" - solved = self._solve_attempt(in_state, out_state, index) + solved = self._solve_attempt(in_state, out_state, index, attempt=attempt + 1) if not solved: message = self._prepare_problems_message(pins=out_state.pins) exc = LibMambaUnsatisfiableError(message) diff --git a/news/394-max-attempts b/news/394-max-attempts index 6a3742b4..1f6d8d5c 100644 --- a/news/394-max-attempts +++ b/news/394-max-attempts @@ -1,6 +1,6 @@ ### Enhancements -* Add some boundary checks to `CONDA_LIBMAMBA_SOLVER_MAX_ATTEMPTS`. (#394) +* Add some boundary checks to `CONDA_LIBMAMBA_SOLVER_MAX_ATTEMPTS`. (#394, #403) ### Bug fixes