On 03. 07. 24 18:02, Marián Konček wrote:
As many of you know, as packages change, so do their BuildRequires. In the
current state, maintaining them requires some manual work from the maintainer.
Thanks!
(As a side note, I encourage everybody to use %genearte_buildrequires from
upstream metadata/code as much as possible, it helps remove stale BuildRequires
quite a lot. I can help you design a macro for this for your ecosystem (e.g.
Perl, Maven)).
1. So I got around the idea of a simple tool that checks file accesses during
the build and using RPM queries, detects whether some package's files are not
accessed at all therefore the package is not needed for the build. To my
knowledge there is no such project. The project is here:
https://github.com/mkoncek/unbreq
It may not be completely reliable, but it also may be good enough to catch
simple mistakes.
I read the documentation. Should this be executed after %check rather than
after %install?
2. At least in the case of maven build system, this tool does not help with
`mvn(foo:bar)` dependencies, as maven unconditionally reads all the files
present in /usr/share/maven-metadata, from which it deduces the associations
between jars and artifact coordinates. I imagine other build systems employ a
similar strategy.
I imagine that for Python packages, this will be similar, as Python tools would
likely read all the installed .dist-info, .egg-info metadata regardless of
whether they actually need those packages.
Perhaps there could be a regex/glob based ignore-list of files that should not
count?
3. In the case of maven, we have a manual tool: xmvn-builddep, which reads the
build.log and constructs the actual BuildRequires from it, using knowledge
about the build procedure. This could be used as an additional step of this
tool, having similar tools for other languages.
Ultimately, I am interested in the possibility of having automated unused
BuildRequires detection as part of rpmbuild / mockbuild.
I +1 Mirek's opinion to make this a mock plugin. That way, we can run it in
bulk without modifying the specs.
--
Miro Hrončok
--
Phone: +420777974800
Fedora Matrix: mhroncok
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue