-
Notifications
You must be signed in to change notification settings - Fork 94
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
dnf5: Print command line hints after resolve failure #1328
Conversation
c27ab3a
to
cf429e4
Compare
dnf5/main.cpp
Outdated
// walk through all solver problem to detect a conflict, missing file dependency and best | ||
for (const auto & resolve_log : context.get_transaction()->get_resolve_logs()) { | ||
if (resolve_log.get_problem() == libdnf5::GoalProblem::SOLVER_ERROR || | ||
resolve_log.get_problem() == libdnf5::GoalProblem::SOLVER_PROBLEM_STRICT_RESOLVEMENT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask you why you would like to analyze libdnf5::GoalProblem::SOLVER_PROBLEM_STRICT_RESOLVEMENT
and not only libdnf5::GoalProblem::SOLVER_ERROR
? When libdnf5::GoalProblem::SOLVER_ERROR
is missing it means that current setting does not require any modification for the success?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. I wanted to investigate what STRICT_RESOLVEMENT
actually means before pushing, but I forgot. Will do now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases (Fedora or best-false) dnf upgrade might provide a warning (problem - libdnf5::GoalProblem::SOLVER_PROBLEM_STRICT_RESOLVEMENT) due to missing file dependencies. This is only case when a hint might make sense. But I am not sure, because the warning should be scary enough but without a hint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, you are right. I will remove SOLVER_PROBLEM_STRICT_RESOLVEMENT
solver problems from analysis.
Print to the user relevant hints about what command line options could be used to fix transaction resolving issues. It can suggest using --skip-unavailable, --no-best, --allowerasing, --skip-broken, and --setopt=optional_metadata_types=filelists Fixes: #548
} | ||
break; | ||
case libdnf5::ProblemRules::RULE_BEST_1: | ||
case libdnf5::ProblemRules::RULE_BEST_2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: I am proposing to add one hint more for package dnf-data-4.19.0-20240326004737.13.ga6d82221.fc38.noarch is filtered out by exclude filtering
.
LGTM |
Print to the user relevant hints about what command line options could
be used to fix transaction resolving issues.
It can suggest using --skip-unavailable, --no-best,
--allowerasing, --skip-broken, and --setopt=optional_metadata_types=filelists
Fixes: #548
Fixes: #1131
Because the PR changes the stderr output, some tests need adjustments: rpm-software-management/ci-dnf-stack#1473