`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
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?
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.
> 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..
Clearing leftover needinfo, answered in comment #2.
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.
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle. Changing version to 32.
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.
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.
Reopening, doesn't seem to be resolved, nor claimed WONTFIX. Should we flip this against dnf5?