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

dnf5: Print command line hints after resolve failure #1328

Merged
merged 1 commit into from
Mar 28, 2024
Merged

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Mar 19, 2024

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

@m-blaha m-blaha force-pushed the mblaha/hints branch 3 times, most recently from c27ab3a to cf429e4 Compare March 20, 2024 09:12
@m-blaha m-blaha marked this pull request as ready for review March 20, 2024 13:07
@j-mracek j-mracek self-assigned this Mar 21, 2024
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) {
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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:
Copy link
Contributor

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.

@j-mracek
Copy link
Contributor

LGTM

@j-mracek j-mracek added this pull request to the merge queue Mar 28, 2024
Merged via the queue into main with commit f4c8df1 Mar 28, 2024
12 of 22 checks passed
@j-mracek j-mracek deleted the mblaha/hints branch March 28, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print a hint on transaction file dependency failure Add hints when transaction fails for DNF5 outputs
2 participants