Bug 2317531

Summary: dnf5 builddep does not report detail for parsing failure
Product: [Fedora] Fedora Reporter: Barry Scott <barry>
Component: dnf5Assignee: rpm-software-management
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 41CC: egoode, fpedrosa, jkolarik, nsella, pkratoch, ppisar, rpm-software-management, samuel-rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-09-16 19:05:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Barry Scott 2024-10-09 09:39:52 UTC
dnf4 reports the reason why it fails to parse which allows the user to fix errors, like getting the path to the spec file wrong.

But dnf5 does not report a reason leaving the user unable to understand what is wrong.


Reproducible: Always

Steps to Reproduce:
1. sudo dnf builddep systemd.spec

Actual Results:  
$ sudo dnf builddep systemd.spec
[sudo] password for barry:
Updating and loading repositories:
 Fedora 41 - aarch64                                                            100% |  99.3 KiB/s |  18.3 KiB |  00m00s
 Fedora 41 - aarch64 - Test Updates                                             100% | 122.6 KiB/s |  19.9 KiB |  00m00s
 Fedora 41 - aarch64 - Updates                                                  100% |  47.0 KiB/s |  20.9 KiB |  00m00s
 Copr repo for tools owned by barryascott                                       100% |   3.7 KiB/s |   1.5 KiB |  00m00s
 Copr repo for tools-testing owned by barryascott                               100% |  10.0 KiB/s |   1.5 KiB |  00m00s
 Fedora 41 - aarch64                                                            100% |   2.8 MiB/s |   3.9 MiB |  00m01s
 Fedora 41 - aarch64 - Test Updates                                             100% |   1.8 MiB/s |   1.7 MiB |  00m01s
Repositories loaded.
Failed to parse spec file "systemd.spec".
Failed to parse some inputs.


Expected Results:  
dnf reports why it failed to parse.

Comment 1 Evan Goode 2024-10-17 22:39:12 UTC
This is valid. RPM prints these errors to the RPM log rather than exposing them in via the API. The change to DNF 4 to add these error messages was https://github.com/rpm-software-management/dnf-plugins-core/commit/4e4c72f8c8ecd6531e4d97ecdd093e29f512edf2, I suspect we will need to add something similar to DNF 5.

Comment 2 Fellipe Henrique 2025-09-16 19:05:06 UTC
Couldn't reproduce on latest version. DNF5 already show the error messages on latest version

Comment 3 Petr Pisar 2025-09-17 08:33:47 UTC
The RPM spec parser errors are now printed to stderr. Tested with:

dnf5-5.2.16.0-1.fc41.x86_64
rpm-libs-4.20.1-1.fc41.x86_64

It could be fixed in rpm-libs, probably in 4.20.0.