/rpmgrill

Static package analysis of RPM builds

Primary LanguagePerlArtistic License 2.0Artistic-2.0

RPMGrill

Overview

Copr Build Status

This is rpmgrill, a set of analysis tests that run against a particular RPM build. It principally differs from rpmlint in that rpmgrill handles builds, that is, the entire set of RPMs built from one source RPM.

For example, rpmgrill can warn about missing man pages; "make" errors or warnings buried in the build logs; or common spec file mistakes. rpmgrill does not know about baselines or previous builds; it does no comparisons, only isolated analysis of one build.

Testing Your Builds

Terminology

A build refers to a collection of RPMs built from a single source RPM (which is included in the build). For purposes of this document, builds are assumed to be generated by koji.

Invoking

The rpmgrill tool tests not only RPM files themself, but also auxiliary files (e.g. the build log). The simplest way to start is to use the koji client to download your RPMs including logs and run rpmgrill over them.

$ mkdir testdir && cd testdir
$ koji download-task --logs <task id>
$ rpmgrill-unpack .  # unpack all rpms in the current directory
$ rpmgrill unpacked  # the unpacked directory is created by rpmgrill-unpack

rpmgrill runs silently, although there may be occasional output to stdout or stderr during development of tests. These messages are not preserved anywhere; they are intended for development and for detecting rare problems.

Results

Three data files, same thing in different formats:

rpmgrill.json
rpmgrill.xml
rpmgrill.yaml

These files contain standard information describing the build being tested (N-V-R, data analyzed, version of the tools) and zero or more reports from failing tests.

Development

To add, extend, or fix individual rpmgrill tests see README.devel-tests

For deeper development, such as ongoing maintenance or infrastructure development (or perhaps infrastructure bug fixes), see README.devel-deep

Reporting Bugs

Please report bugs or issues against rpmgrill in Bugzilla.

You can browse existing bugs filed against the rpmgrill Fedora package or rpmgrill itself.

Nightly Builds

Easy installable packages are available via Fedora copr.

Debugging test failures in Fedora Copr

In case tests fail in the copr builds, you can run the mock command locally. Here is an example illustrating the process:

# create an archive of the current release (check the spec file)
# Also note, that this makes an archive from the current HEAD. Whatever is not
# in a commit in git will not be part of the archive.
$ git archive --format=tar --prefix=rpmgrill-0.30/ HEAD | gzip > 0.30.tar.gz

# copy it into your rpmbuild directory
$ mv 0.30.tar.gz ~/rpmbuild/SOURCES

# create an src.rpm from your local spec file and the created archive
$ rpmbuild -bs rpmgrill.spec

# build it in mock which runs the tests
$ mock -r fedora-26-x86_64 --rebuild ~/rpmbuild/SRPMS/rpmgrill-0.30-1.fc25.src.rpm

# Now log in and debug. Don't forget --no-clean.
$ mock -r fedora-26-x86_64 --no-clean --shell

Changelog

v0.34 (2019-03-27)

  • rpmgrill will not record a failure if icons are declared with a base filename without a path in the theme specification. (Thanks to Petr Pisar).

v0.33 (2018-06-04)

  • rpmgrill will not record a failure any more if a config file will not have a corresponding man page. (Thanks to Adam Williamson)

  • The deprecated scripts rpmgrill-fetch-build and rpmgrill-analyze-local have been removed.

v0.32 (2017-11-03)

  • rpmgrill will not warn anymore if scripts use dynamic UIDs, based on a patch contributed by Colin Walters

v0.31 (2017-09-05)

  • rpmgrill-unpack-rpms: now also attempts in copying downloaded build logs from Koji into unpacked sub directories.

  • rpmgrill-fetch-build and rpmgrill-analyze-local marked as deprecated and will be removed in the next release.

  • rpmgrill will now exit with an exit code of 1 to indicate the test run had failures and 0 to indicate a success.

  • rpmgrill now recognizes executables linked with new dtags (BIND_NOW) (Petr Pisar).