Bug 2317531 - dnf5 builddep does not report detail for parsing failure
Summary: dnf5 builddep does not report detail for parsing failure
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 41
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-09 09:39 UTC by Barry Scott
Modified: 2025-09-17 08:33 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-09-16 19:05:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.