1 |
Introduction |
2 |
============ |
3 |
|
4 |
Recently, once again we were confronted with a package marked as |
5 |
ppc-macos stable, while it didn't compile at all, let alone run. It is |
6 |
believed more of these packages are in portage, and need to be found and |
7 |
fixed. Keeping the cause of why they are marked stable up to another |
8 |
discussion, and out of the scope of this discussion, I will focus on how |
9 |
to track these packages down and report them to us. |
10 |
|
11 |
In the secondary line, all 'unstable' packages, marked ~ppc-macos should |
12 |
be tested as well, since they can be faulty as well. Since for OSX much |
13 |
is in ~ppc-macos, many users consider it a normal procedure to switch to |
14 |
the unstable side of portage, hence some extra need for careful testing |
15 |
of ~ppc-macos also. |
16 |
|
17 |
|
18 |
Proposed Global Structure |
19 |
========================= |
20 |
|
21 |
Testing should be done on a regular basis, both push and pull based. |
22 |
This means that the testing machine would start testing packages itself |
23 |
if it is out of work, and on the other hand starts testing packages as |
24 |
soon as they are being added/changed in CVS. It may need no great |
25 |
imagination to see that the latter 'push-based' activity has priority |
26 |
over the 'pull-based' work. |
27 |
|
28 |
Starting over, will for the test machine mean that it starts cleaning |
29 |
out its world file. Cleaning this file out to a bare minimum is an |
30 |
important aspect of getting a test environment that reflects the |
31 |
situation on new user's machines. If an ebuild uses a package without |
32 |
having it in it's DEPEND, this may get noticed only when starting on a |
33 |
clean machine. This, however, will add a big delay in testing as many |
34 |
packages will need to be built prior the right package can be installed. |
35 |
|
36 |
The testing machine will have a queue file, which it reads packages to |
37 |
emerge from. If the queue file is empty, i.e. when there is no push |
38 |
based work, the machine will generate work by starting to compile |
39 |
uncompiled packages, or emptying the tree. |
40 |
|
41 |
Because ~ppc-macos and ppc-macos packages interfere with each other -- a |
42 |
~ppc-macos package overwrites a ppc-macos package -- both stable and |
43 |
unstable have to be dealt with separately, i.e. they should both have |
44 |
their own environment either via two separate machines, or through the |
45 |
use of a chroot jail. |
46 |
|
47 |
|
48 |
Queues |
49 |
------ |
50 |
|
51 |
In order not to drag in a full DBMS (in the end Portage already is one) |
52 |
queues are just simple flat files consisting of absolute package names, |
53 |
one per line. Table wise locking granularity is handled by the OS as |
54 |
one process opens the file in write mode. Consumers -- the testing box |
55 |
in this case -- read the first line and delete it, while producers |
56 |
simply add one line (or more) to the end of the file. |
57 |
|
58 |
The queue itself, is more a set than a list. This means that packages |
59 |
that are in the queue, should be unique. If a package is added that is |
60 |
already in the queue, it is dropped such that the original queue |
61 |
position of the package is maintained. |
62 |
|
63 |
|
64 |
CVS Producer |
65 |
------------ |
66 |
|
67 |
To catch up automatically with changes made to the tree, it is necessary |
68 |
to act upon any commit to the tree for an ebuild file. A possibility to |
69 |
do this would be via processing of CVS commit messages, sent out as |
70 |
email by the CVS server. It is a task of the producer to find out |
71 |
whether the ebuild found applies to the testing machine (ppc-macos) and |
72 |
add the package/ebuild to the queue. |
73 |
|
74 |
|
75 |
Consumer (testing process) |
76 |
-------------------------- |
77 |
|
78 |
The test machine reads a line from the queue, and basically executes |
79 |
'emerge ${PACKAGE}'. However, before doing this, first it figures out |
80 |
which use flags can be used (emerge -pv) and which dependencies will be |
81 |
pulled (emerge -pt). If portage returns the message all ebuilds that |
82 |
could satisfy X have been masked, the emerge is cancelled, the line is |
83 |
removed from the queue and an email message will be sent out. |
84 |
|
85 |
All dependencies are put in the right order and emerged as normal |
86 |
packages, that is: all dependencies are pushed at the front of the |
87 |
queue, thereby keeping uniqueness of the queue and removing duplicates |
88 |
that appear later on in the queue. After this, the consumer is |
89 |
restarted and reads again from the queue. This should result in usually |
90 |
merging only one package at a time, and as such quite isolated cases, |
91 |
which should improve the error email notification service. |
92 |
|
93 |
Compile testing a package is supposed to be a thorough test that tries |
94 |
all possible combinations of the package's USE flags. As this might be |
95 |
somewhat endless as some packages are rather big and have zillions of |
96 |
USE flags, it may be necessary to have a special "don't do it" file. |
97 |
Since all dependencies were put at the front of the queue, there should |
98 |
normally be no dependencies that the package pulls. |
99 |
If compilation fails for a certain USE-flag combination this is reported |
100 |
by sending out an email, and compilation of the next USE-flag |
101 |
combination is attempted. |
102 |
|
103 |
When everything goes fine, no email notification is being sent out. A |
104 |
convenient log structure would, however, make it possible to see which |
105 |
packages and USE-flag combinations successfully passed through. |
106 |
Providing this log via a web-page would be a useful thing. Again |
107 |
backing this with a DBMS to allow easy searching, versioning and stuff |
108 |
is considered to be overhead, though crafting logs in SQL's "INSERT |
109 |
INTO" format might enable another machine to display the output data. |
110 |
Perhaps the communication methods needs a section on itself. |
111 |
|
112 |
|
113 |
Recap and Conclusion |
114 |
==================== |
115 |
|
116 |
By setting up a testing system, it is possible to greatly improve the |
117 |
Quality of Service of the portage tree for an architecture by exhaustive |
118 |
testing of both packages already in there, as well as packages added or |
119 |
modified. Automated testing should not release developers from testing |
120 |
themselves, but should help in pointing out problems that may arise on |
121 |
moving grounds such as portage where packages are constantly updated and |
122 |
dependencies might get broken. |
123 |
|
124 |
|
125 |
ToDo |
126 |
==== |
127 |
|
128 |
- Not only check dependencies of the respective package, but also |
129 |
consider packages that depend on the respective package, thus rebuilding |
130 |
all packages that depend on the package to check if anything is broken |
131 |
by the update. |
132 |
- Is there a gleptomaniac in the room? This would be useful for x86 |
133 |
also, of course. In that case it may be necessary to make sure the |
134 |
packages are split over multiple machines. |
135 |
- The message system needs more customisation options, especially |
136 |
backing things by a DBMS would allow for many nice bugzilla-like |
137 |
preferences for email generation as well as web-based versioned |
138 |
info/report pages |
139 |
- To make the system even bigger, a central DBMS powered server might |
140 |
take a leading role and ... {editor note: wait, stop it right now, |
141 |
you're going too fast right now} |
142 |
|
143 |
|
144 |
By The Way |
145 |
========== |
146 |
|
147 |
- Kito offers his lil' chico as machine for this automated testing |
148 |
initiative. |
149 |
- Comments are welcome, as well as expressions of worry on my mental state. |
150 |
- Implementation of described system will need some better specified |
151 |
system and needs some coding (the dirty work) in some language... |
152 |
|
153 |
|
154 |
-- |
155 |
Fabian Groffen |
156 |
eBuild && Porting |
157 |
Gentoo for Mac OS X |
158 |
|
159 |
-- |
160 |
gentoo-osx@g.o mailing list |