Bug 1778786 - builddep should handle dynamic buildrequires somehow
Summary: builddep should handle dynamic buildrequires somehow
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-02 13:54 UTC by Pavel Raiskup
Modified: 2025-06-11 05:25 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-05-25 15:12:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Raiskup 2019-12-02 13:54:28 UTC
`dnf builddep` only handles normal BuildRequires nowadays.  But it should
handle dynamic buildrequires as well.  Try e.g. with python-copr.spec [1]:

    $ LANG=en_US.utf8 sudo dnf builddep python-copr.spec
    ...
    Nothing to do.
    Done!

Even though python-wheel-wheel-1:0.33.1-3.fc31.noarch is not installed on my
box, and thus the build would fail.

Mock uses this to detect requested build requires:

    $ /usr/bin/rpmbuild -br --target x86_64 --nodeps dummy-pkg.spec

[1] https://pagure.io/copr/copr/blob/master/f/python/python-copr.spec

Comment 1 Marek Blaha 2019-12-05 08:45:04 UTC
We cannot use `rpmbuild -br`, because it will require to have also the source tarball installed and the only thing we have available is the spec file itself. The other problem is that `-br` is relatively new switch (it is not available in F30 nor in RHEL8).

To calculate build requires DNF uses rpm python API:

spec = rpm.spec(spec_fn)
deps = rpm.ds(spec.sourceHeader, 'requires')

I'm not aware of any way how to get those dynamic build requirements calculated from the spec using the API. Panu, Florian, is there such a way?

Comment 2 Panu Matilainen 2019-12-09 09:13:33 UTC
Pretty much the whole point of dynamic buildrequires is that they allow you to generate dependencies from the source. So no, there's no way to get them from the spec alone.

I'd suggest to have dnf builddep check whether a spec has dynamic buildrequires (ie if there's a "rpmlib(DynamicBuildRequires)" dependency in the source requires), and simply error out with an informative message if that's the case.

Comment 3 Pavel Raiskup 2019-12-09 14:47:55 UTC
> simply error out with an informative message

Sure this hint is better than nothing, though anyways ... once
dynamic build requires become more widely used, the builddep
dnf command may become a bit useless..

Comment 4 Panu Matilainen 2020-01-13 10:41:24 UTC
Clearing leftover needinfo, answered in comment #2.

Comment 5 Florian Festi 2020-01-31 08:06:15 UTC
To elaborate on this a bit more and fill in the in person discussion of last week:

To get the full list of build dependencies one has either actually do a build or use the data from an srpm that was build either regularly or with rpmbuild -rb. As Panu already stated there is no way to get the dynamic build requires other than actually do those build stages with the sources available.

So there are multiple options:

1) Accept that the list of dependencies is incomplete and that the user has to call dnf builddeps repeatedly for each round the build turns up new build dependencies.
2) Offer a new dnf build command that - similarly to mock - starts the actual build and will install newly found build dependencies automatically and then restart the build
3) Offer a command that will instead of using the spec file try top get the fully build srpm from the source repository to get the full list of build dependencies from there. This is kinda wacky but should work for many use cases where people try to rebuild/alter existing distibution packages.

Comment 6 Ben Cotton 2020-02-11 17:21:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 7 Fedora Program Management 2021-04-29 16:00:38 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ben Cotton 2021-05-25 15:12:42 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Pavel Raiskup 2023-04-13 15:55:35 UTC
Reopening, doesn't seem to be resolved, nor claimed WONTFIX.
Should we flip this against dnf5?


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