Detector of unused BuildRequires
of RPM builds.
Build the project:
$ make all
Either install or install symlink of the Python plugin and the executable file watcher:
# make install
# make install-link
To uninstall:
# make uninstall
Note
|
This project is in a very early stage. |
This project is currently implemented as a mock plugin.
The native part uses fanotify
to watch filesystem accesses.
To run it, install it and then enable it from the command line:
mock --enable-plugin=unbreq
In logs you should see messages like:
INFO: enabled unbreq plugin
If Unbreq detects an unneeded BuildRequire
it prints a message like:
Unbreq plugin: the following BuildRequires were not used: ${packages}
-
❏
FAN_MARK_MOUNT
fanotify_mark
should be able to work with this parameter instead ofFAN_MARK_FILESYSTEM
. For this to work, the mock build needs to happen inside a bind-mounted directory. If implemented, we avoid monitoring all the filesystem activity and can completely avoid any filtering. -
❏ Robust mock root binding
We need to query
dnf
because of potentially complexBuildRequires
expressions. Ideally exactly the binary from the bootstrap root using chroot. However, thednf
needs to use the build chroot as the--installroot
so it needs to have access outside of its chroot. Currently this is done viamount --bind
which needs to be unmmounted when the plugin is finished. This is fragile and can leave mounted volume if the process is interrupted. -
❏
libdnf
We are currently invoking
dnf
to query needed information. It may be possible to uselibdnf
directly.