Skip to content

Commit

Permalink
Use SOLVER_FLAG_FOCUS_NEW to install latests versions of deps
Browse files Browse the repository at this point in the history
This is a new flag in the recent 0.7.30 release.

We previously tried to use `SOLVER_FLAG_FOCUS_BEST` but it turned out to
be too strong, this new flag should update packages only if it is
required for installing the latests versions of dependencies.

We had several reports where users expect this behavior.

This should properly resolve issue such as:
https://bugzilla.redhat.com/show_bug.cgi?id=2150300
https://issues.redhat.com/browse/RHEL-1374
  • Loading branch information
kontura committed Jul 15, 2024
1 parent 9c2e215 commit 313bcd4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dnf5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Provides: dnf5-command(versionlock)

%global libmodulemd_version 2.5.0
%global librepo_version 1.18.0
%global libsolv_version 0.7.25
%global libsolv_version 0.7.30
%global sqlite_version 3.35.0
%global swig_version 4
%global zchunk_version 0.9.11
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if (WITH_MODULEMD)
target_link_libraries(libdnf5_static PRIVATE ${LIBMODULEMD_LIBRARIES})
endif()

pkg_check_modules(LIBSOLV REQUIRED libsolv>=0.7.25)
pkg_check_modules(LIBSOLV REQUIRED libsolv>=0.7.30)
list(APPEND LIBDNF5_PC_REQUIRES "${LIBSOLV_MODULE_NAME}")
target_link_libraries(libdnf5 PRIVATE ${LIBSOLV_LIBRARIES})
target_link_libraries(libdnf5_static PRIVATE ${LIBSOLV_LIBRARIES})
Expand Down
3 changes: 3 additions & 0 deletions libdnf5/rpm/solv/goal_private.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ libdnf5::GoalProblem GoalPrivate::resolve() {
libsolv_solver.set_flag(SOLVER_FLAG_ALLOW_VENDORCHANGE, vendor_change);
libsolv_solver.set_flag(SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, vendor_change);

// Ensure the solver tries to install the latest versions of dependencies, even if it results in a bigger transaction
libsolv_solver.set_flag(SOLVER_FLAG_FOCUS_NEW, 1);

if (libsolv_solver.solve(job)) {
return libdnf5::GoalProblem::SOLVER_ERROR;
}
Expand Down

0 comments on commit 313bcd4

Please sign in to comment.