Finding Useless Buildrequires at build time using URPM ecosystem
Experimentations around discovering useless buildrequires directives in specs files. First experimenting in Mandriva's URPM context.
Code is available in branches at :
- http://
- http://
Some code is available to run a massive rebuild, and grab the logs, then do some plots:
http://
Overview results on Cooker's python-* SRPMs packages, as of 2011, dec:
$ screen -L sh -c 'for pkg in rpm/SRPMS/python-*; do jurt-build -c $pkg && for fs in `grep jurt /proc/mounts | cut -d" " -f2`; do sudo umount $fs; done && sudo rm -rf /var/spool/
[user@cooker ~]$ cat /home/jurt/
==== started log at Wed Dec 28 11:09:13 2011
Found the following useless BuildRequires: ncursesw-devel (lib64ncursesw-
build_packages_
==== started log at Wed Dec 28 11:10:49 2011
Found the following useless BuildRequires: python-twisted (python-twisted), . Took a total of 29 secs.
build_packages_
==== started log at Wed Dec 28 11:42:25 2011
Found the following useless BuildRequires: python-twisted (python-twisted), . Took a total of 30 secs.
build_packages_
==== started log at Wed Dec 28 11:48:13 2011
Found the following useless BuildRequires: gnupg (gnupg), . Took a total of 18 secs.
build_packages_
==== started log at Wed Dec 28 11:51:29 2011
Found the following useless BuildRequires: gtk-doc (gtk-doc), automake (automake), . Took a total of 47 secs.
build_packages_
==== started log at Wed Dec 28 11:55:03 2011
Found the following useless BuildRequires: gtk-doc (gtk-doc), automake (automake), . Took a total of 31 secs.
build_packages_
==== started log at Wed Dec 28 12:04:04 2011
Found the following useless BuildRequires: libGConf2-devel (lib64GConf2-
build_packages_
==== started log at Wed Dec 28 12:09:31 2011
Found the following useless BuildRequires: png-devel (lib64png0-devel, lib64png-devel), . Took a total of 78 secs.
build_packages_
==== started log at Wed Dec 28 12:59:32 2011
Found the following useless BuildRequires: ipython (ipython), python-configobj (python-configobj), libwxPythonGTK-
build_packages_
==== started log at Wed Dec 28 13:17:06 2011
Found the following useless BuildRequires: tcl (tcl), tk-devel (lib64tk-devel), mesaglut-devel (lib64mesaglut3
build_packages_
==== started log at Wed Dec 28 13:42:38 2011
Found the following useless BuildRequires: tetex-latex (texlive-
build_packages_
==== started log at Wed Dec 28 13:44:45 2011
Found the following useless BuildRequires: libpython-devel (lib64python-
build_packages_
==== started log at Wed Dec 28 13:47:36 2011
Found the following useless BuildRequires: python-dbus (python-dbus), dbus-glib-devel (lib64dbus-
build_packages_
==== started log at Wed Dec 28 14:09:52 2011
Found the following useless BuildRequires: python-simplejson (python-
build_packages_
==== started log at Wed Dec 28 14:13:03 2011
Found the following useless BuildRequires: python-
build_packages_
$ echo "package build_packages_
python-2.7.2-3 54.1022000313 0.284519910812 22.7554020882 0.0244071483612 0.400624036789
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-psyco-1.6-7 12.4180939198 0.254108190536 1.1321451664 0 0.563099145889
python-
python-
python-
Can be transformed to the following gnuplot data file:
# package build_packages_
python-2.7.2-3 54.1022000313 0.284519910812 22.7554020882 0.0244071483612 0.400624036789
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-psyco-1.6-7 12.4180939198 0.254108190536 1.1321451664 0 0.563099145889
python-
python-
python-
Which then can be plotted with:
set title "Useless BuildRequires verification additional build time"
set term png size 1920,1080 enhanced
set out "buildrequires.png"
set ylabel "Time (secs)"
set y2label "Total time (secs)"
set xtics out rotate by -90
set y2tics auto
set logscale y
set grid
plot "buildrequires.txt" using 2:xtic(1) axes x1y1 with linespoints title "build-
Blueprint information
- Status:
- Started
- Approver:
- Jeff Johnson
- Priority:
- Low
- Drafter:
- Pirouette Cacahuète
- Direction:
- Approved
- Assignee:
- Pirouette Cacahuète
- Definition:
- Pending Approval
- Series goal:
- Accepted for 5.4
- Implementation:
-
Needs Code Review
- Milestone target:
- None
- Started by
- Pirouette Cacahuète
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Whiteboard cleared by moving text into the summary.
I'd like to see this functionality in RPM itself: there are many usage
cases for notify(7), not just in detecting unused BuilRequires:
The methods needed aren't hard, and an rpm "object" with
reference counts and mutex's is fairly simple wrapping, and
arranging for bindings onto a C object would permit other
more efficient (than python dicts and perl ties) to be used
for what are essentially set membership operations of
file paths and dependency assertions. (I'm thinking of
Yet Another Use for Bloom filters here).
Work Items
Dependency tree

* Blueprints in grey have been implemented.