Test all three matrices
[Fedora-Rebuild.git] / rebuild
blobdb5f832eed788b621231fd9913061ea8e3aa379c
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use lib qw( . );
5 use Fedora::Rebuild;
7 my $builder = Fedora::Rebuild->new(
8 all => 'testall',
9 done => 'testdone',
10 failed => 'testfailed',
11 gitdir => 'git',
12 dist => 'rawhide',
13 message => 'Scratch rebuild test');
14 exit !$builder->run;
17 __END__
18 =head1 NAME
20 rebuild - Rebuilds perl packages from scratch
22 =head1 DESCRIPTION
24 Main goal is to rebuild perl modules packages for Fedora. The rebuild is
25 driven from bottom to top, i.e. from perl interpreter to modules depending on
26 intermediate modules. This way, it's possible to upgrade perl interpreter to
27 incompatible version and to rebuild all modules against the new interpreter.
29 Procedure is following: We have a set of source package to rebuild. We
30 destile all build-time dependencies for each source package. We ignore
31 non-perl dependencies as we focus on Perl only.
33 We select all source packages that do not depend on anything and push them
34 into Koji to rebuild. Obviously, the only fulfilling package is Perl interpret
35 only.
37 Once the first subset of packages is rebuilt, we gather their binary packages
38 and destile their binary provides. This freshly available provides are put
39 into new set of available provides. At the same time we remove the rebuilt
40 subset from original set of all source packages.
42 Then we wait for build root rotation in Koji to get rebuilt binary packages
43 available in build root.
45 (Of course we can get provides of new binary packages from koji repository
46 after rotation and we can get provides through repoquery instead of
47 inspecting binary packages manually.)
49 The we return to start of this procedure to select other subset of source
50 packages whose build-time dependecies can be satisfied from set of binary
51 provides we have obtained till now.
53 This loop cycles until set of source packages is empty.
55 =head1 SYNCHRONIZATION
57 Because mass rebuild is long term issue and lot of intermediate failures can
58 emerge, one must be able to resume failed rebuild process.
60 Safe resume is assured by proper logging. Once a package has been rebuilt, its
61 name with gathered metadata (binary provides) is logged into list of done
62 packages. Starting rebuild program with the same arguments loads done
63 packages, remove them from set of remaining packages, and populates list of
64 available provides. In additon, packages whose rebuild failed are logged and
65 removed from set of remaining packages.
67 This leads to idea that set of all packages can be decomposed into four
68 classes: set of packages remaning to rebuild, set of done (rebuilt) packages,
69 set of already failed packages, and set of packages that were being rebuilt
70 when process was interrupted.
72 This fourth (probably small) set is officially part of remaining set, but we
73 should assure we do not modify git repository or resubmit package that was
74 beeing compiled in Koji. This is treated by creating lock files after each
75 step of package rebuild is completed (repository clonning, getting list of
76 build-time dependencies, committig rebuild change, submitting for rebuild,
77 finishing rebuild, build root rotation, etc.). Script can find last safe state
78 of rebuilding package and skip alredy performed (irreversible or expensive)
79 rebuild step.
81 =head1 TODO
83 =over 8
85 =item Rebuild in parallel
87 =item Consider all architectures
89 Prepare source packages and destile build-time dependencies for all supported
90 architectures as some build-time dependencies are conditionalizaed by
91 architecture.
94 =head1 AUTHOR
96 Petr Pisar <ppisar@redhat.com>
98 =head1 COPYING
100 Copyright (C) 2011 Petr Pisar <ppisar@redhat.com>
102 This program is free software: you can redistribute it and/or modify
103 it under the terms of the GNU General Public License as published by
104 the Free Software Foundation, either version 3 of the License, or
105 (at your option) any later version.
107 This program is distributed in the hope that it will be useful,
108 but WITHOUT ANY WARRANTY; without even the implied warranty of
109 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110 GNU General Public License for more details.
112 You should have received a copy of the GNU General Public License
113 along with this program. If not, see <http://www.gnu.org/licenses/>.
115 =cut