Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2005_01_02.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: January  2, 2005 - January  8, 2005 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/week_2004_12_26.html" title="December 26, 2004 - January  1, 2005" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2005_01_09.html" title="January  9, 2005 - January 15, 2005" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/week_2004_12_26.html">&laquo; December 26, 2004 - January  1, 2005</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2005_01_09.html">January  9, 2005 - January 15, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">January  7, 2005</h2>
44                      <a id="a000273"></a>
45                      <div class="entry" id="entry-273">
46                         <h3 class="entry-header">ecrdesc</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <p>Well I played around with this a little more and came up with a Perl script that will dump ECR descriptions fairly easy. From what I understand that's mostly what we want access to from a Linux box (though I could envision wanting other things perhaps in the future). The problem as I see it is that this script will only run on lynx12. It should be runnable from any machine really however you would need to install the DBD module for Informix for Perl access. Unfortunately this requires at least an Informix Client SDK and that's not free!  :-(</p>
50                               
51                               <p>Here's the simple script (currently at lynx12:/tmp/ecrdesc.pl):</p>
52
53 <div class="code"><pre>
54 #!/usr/bin/perl
55 ################################################################################
56 #
57 # File:         ecrdesc
58 # Description:  This script will dump out the description for the ECR #(s)
59 #               passed in.
60 # Author:       Andrew@DeFaria.com
61 # Created:      Fri Jan  7 15:35:13 PST 2005
62 # Language:     Perl
63 #
64 # (c) Copyright 2005, LynxWorks Inc., all rights reserved
65 #
66 ################################################################################
67 use strict;
68 use warnings;
69 use DBI;
70
71 my $DB;
72
73 # Called when a database error has occurred
74 sub DBError {
75   my $msg       = shift;
76   my $statement = shift;
77
78   print $msg . "\nError #" . $DB->err . " " . $DB->errstr . "\n";
79
80   if (defined $statement) {
81     print "SQL Statement: $statement\n";
82   } # if
83
84   exit $DB->err;
85 } # DBError
86
87 # Connect to database. Note this is using anonymous access (read only)
88 $DB = DBI->connect("DBI:Informix:lynxmigr1")
89   or DBError "Unable to open database";
90
91 # Loop through ECR #s from the command line
92 foreach my $ecr (@ARGV) {
93   print "ECR #: $ecr\n";
94
95   my $statement    = "select description from defect where pkey=\"$ecr\"";
96   my $sth    = $DB->prepare ($statement)
97     or DBError "Unable to prepare statement", $statement;
98
99   $sth->execute ()
100     or DBError "Unable to execute statement", $statement;
101
102   # Defect records are unique per pkey (AKA ECR) there for there will
103   # only be one entry in @row. Also the description is returned as one
104   # large string.
105   my @row = $sth->fetchrow_array;
106
107   if (!@row) {
108     # @row is empty if there was no ECR by that number
109     print "Nothing found!\n";
110   } else {
111     my $desc = pop @row;
112     print "Description:\n" . "-" x 80 . "\n" . $desc . "\n" . "-" x 80 . "\n";
113   } # if
114 } # foreach
115
116 $DB->disconnect;
117
118 exit;
119 </pre></div>
120                               
121                               <p class="entry-footer">
122                                  <span class="post-footers">Posted by  at  4:03 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000273.html">Permalink</a>
123                                  
124                                  
125                               </p>
126                            </div>
127                         </div>
128                      </div>
129                      
130                      
131
132                      <h2 class="date-header">January  6, 2005</h2>
133                      <a id="a000272"></a>
134                      <div class="entry" id="entry-272">
135                         <h3 class="entry-header">Files4ecr</h3>
136                         <div class="entry-content">
137                            <div class="entry-body">
138                               <ul>
139
140 <li>Finished up files4ecr</li>
141
142 <li>PPC toolchain build W/23084 is failing</li>
143
144 </ul>
145                               
146                               <h3>files4ecr</h4>
147
148 <p>From the <a href="news:gnu.cvs.help">gnu.cvs.help</a> newsgroup I learned that doing a cvs log of everything then grepping through that is <b>much</b> faster than interrogating each file with cvs log. I then reorganized files4ecr to work in the following manner:</p>
149
150 <p>It occurred to me that often we wish to know, or pull, the file
151 revision associated with an ECR #. I've created a script called
152 files4ecr that accomplishes this:</p
153
154 <div class="code"><pre>
155 <font color="#3333ff">saturn:</font><u>files4ecr-u</u>
156 Usage: files4ecr [-v] [-d] [-l] [-x] [-u] &lt;ecr&gt;
157
158 Where:
159  
160         -v:     Turn on verbose mode (Default: off)
161         -d:     Turn on debug mode (Default: off)
162         -l:     Local directory only, no recursion
163         -x:     Turn on execute mode (Default: off)
164         -u:     Dsplay usage
165         ecr     ECR number to search for
166 </pre>
167 </div>
168
169 <p>The performance for this script is pretty good, depending on the amount of information in the CVS logs. Here's an example of it's usage:</p>
170
171 <div class="code"><pre>
172 <font color="#3333ff"><b>saturn:</b></font><u>files4ecr 20505</u>
173 SETUP.csh: 10.2 - Out of date
174 etc/tconfig: 10.2 - Already up to date
175 SETUP.bash: 10.6 - Out of date
176 etc/ttys-arm: 1.1 - Already up to date
177 Makefile: 10.13 - Out of date
178 </pre></div>
179
180 <p>In noexecute mode it just displays the file and the revision of the
181 file associated with that ECR. The -l option is similar to cvs' -l option:</p>
182
183 <div class="code"><pre>
184 <font color="#3333ff">saturn:</font><u>files4ecr -l 20505</u>
185 SETUP.csh: 10.2 - Out of date
186 SETUP.bash: 10.6 - Out of date
187 Makefile: 10.13 - Out of date
188 </pre></div>
189
190 <p>Also, like cvs, files4ecr operates in the current context and current
191 working directory.</p>
192
193 <p>With -x turned on files4ecr will perform the cvs update commands
194 necessary to "pull" the versions for the ECR:</p>
195
196 <div class="code"><pre>
197 <font color="#3333ff">saturn:</font><u>files4ecr -x 20505</u>
198 cvs update -r10.2&nbsp; SETUP.csh - Updated
199 cvs update -r10.2&nbsp; etc/tconfig - Already up to date
200 cvs update -r10.6&nbsp; SETUP.bash - Updated
201 cvs update -r1.1&nbsp; etc/ttys-arm - Already up to date
202 cvs update -r10.13&nbsp; Makefile - Updated
203 </pre></div>
204
205 <p>And we can see that the update has taken place:</p>
206
207 <div class="code"><pre>
208 <font color="#3333ff">saturn:</font><u>files4ecr 20505</u>
209 SETUP.csh: 10.2 - Already up to date
210 etc/tconfig: 10.2 - Already up to date
211 SETUP.bash: 10.6 - Already up to date
212 etc/ttys-arm: 1.1 - Already up to date
213 Makefile: 10.13 - Already up to date
214 </pre></div>
215
216 <p>Anybody interested in such a script?</p>
217
218 <p><b>Note:</b> I've noticed that "ECR Number:" is not necessarily a
219 consistent indicator of an ECR number. I search for several strings:</p>
220
221 <div class="code"><pre>
222 /^ECR Number: (\d*)$/    or
223 /^ECR# (\d*)$/           or
224 /^ECR # (\d*)$/          or
225 /^\s*ECR (\d*)/
226 </pre></div>
227
228 <p>I've also noticed that a single ECR number may be attached to several revisions. files4ecr takes the latest revision in such cases.</p>
229
230 <h2>PPC toolchain build W/23084 is failing</h2>
231
232 <p>Preliminary investigation shows that while attempting to configure libiberty the build process is unable to use gcc to compile things. It seems to be lacking a crt1.o</p>
233                               
234                               <p class="entry-footer">
235                                  <span class="post-footers">Posted by  at 10:31 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000272.html">Permalink</a>
236                                  
237                                  
238                               </p>
239                            </div>
240                         </div>
241                      </div>
242                      
243                      
244
245                      <h2 class="date-header">January  4, 2005</h2>
246                      <a id="a000271"></a>
247                      <div class="entry" id="entry-271">
248                         <h3 class="entry-header">files4ecr.pl</h3>
249                         <div class="entry-content">
250                            <div class="entry-body">
251                               <p>The algorithm that files4ecr.pl uses is indeed slow. Combing through lynxos looking for files involved in ECR 20591 took:</p>
252
253 <div class="code">
254 <pre>
255 real    416m30.889s
256 user    6m43.900s
257 sys     1m42.770s
258 </pre>
259 </div>
260
261 <p>Yikes!</p>
262
263                               
264                               <p class="entry-footer">
265                                  <span class="post-footers">Posted by  at  5:43 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000271.html">Permalink</a>
266                                  
267                                  
268                               </p>
269                            </div>
270                         </div>
271                      </div>
272                      
273                      
274
275                      
276                      <a id="a000270"></a>
277                      <div class="entry" id="entry-270">
278                         <h3 class="entry-header">Building Native Toolchain for PPC</h3>
279                         <div class="entry-content">
280                            <div class="entry-body">
281                               <p>Here's the plan:</p>
282
283 <ol>
284
285 <li>Build Toolchain with PPC fix ECR 23084</li>
286
287 <li>Build LynxOS with the new toolchain</li>
288
289 <li>Build Toolchain natively</li>
290
291 </ol>
292
293                               
294                               <h3>Toolchain build with PPC ECR 23084 fix</h3>
295
296 <p>Seems the individual files for this ECR have already been applied to the work area so I just need to build. Here what I did:</p>
297
298 <ul>
299
300 <li>In <tt>dopey:/export/build1/LYNXOS_500/build/toolchain/3.2.2</tt> I created a directory named 010405 (for today's date).</li>
301
302 <li>Copied a Makefile from 121804/Makefile. With the toolchain all we need is a good make file, make sure that it's SRCDIR is correct (this one points to <tt>/export/build1/LYNXOS_500/work-area/toolchain/3.2.2/toolchain/src</tt>) and that you source <tt>SETUP.bash</tt> setting ENV_PREFIX and target properly (I used <tt>/export/build1/LYNXOS_500/build/lynxos/120604-B/ppc</tt> and, of course, PPC for a target)</li>
303
304 <li>Sourced SETUP.bash</li>
305
306 <li>Did <tt>make install > install.log 2>&1</tt></li>
307
308 </ul>
309                               
310                               <p class="entry-footer">
311                                  <span class="post-footers">Posted by  at  5:08 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000270.html">Permalink</a>
312                                  
313                                  
314                               </p>
315                            </div>
316                         </div>
317                      </div>
318                      
319                      
320
321                      
322                      <a id="a000269"></a>
323                      <div class="entry" id="entry-269">
324                         <h3 class="entry-header">TOT Build Failure</h3>
325                         <div class="entry-content">
326                            <div class="entry-body">
327                               <ul>
328
329 <li>Unable to build TOT due to error in definition of atoi</li>
330
331 </ul>
332                               
333                               <p>Is there a known problem with TOT build? Cause I'm getting an error saying essentially that "atoi is undefined".</p>
334
335 <div class="code">
336 <pre>
337 gcc -g -O2 -o named aclconf.o client.o config.o control.o controlconf.o interfac
338 emgr.o listenlist.o log.o logconf.o main.o notify.o query.o server.o sortlist.o
339 tkeyconf.o tsigconf.o update.o xfrout.o zoneconf.o lwaddr.o lwresd.o lwdclient.o
340 lwderror.o lwdgabn.o lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o  unix/os.o ../../
341 lib/lwres/liblwres.a ../../lib/dns/libdns.a   ../../lib/isccfg/libisccfg.a ../..
342 /lib/isccc/libisccc.a ../../lib/isc/libisc.a  -lnsl
343 /export/build1/LYNXOS_500/build/lynxos/120604-C/x86/lib/libnsl.a(getgrent.as.o):
344 In function `getgrent':
345 getgrent.as.o(.text+0xb4): undefined reference to `atoi'
346 /export/build1/LYNXOS_500/build/lynxos/120604-C/x86/lib/libnsl.a(getgrent.as.o):
347 In function `fgetgrent':
348 getgrent.as.o(.text+0x2b8): undefined reference to `atoi'
349 /export/build1/LYNXOS_500/build/lynxos/120604-C/x86/lib/libnsl.a(getpwent.as.o):
350 In function `getpwent':
351 getpwent.as.o(.text+0xb4): undefined reference to `atoi'
352 getpwent.as.o(.text+0xce): undefined reference to `atoi'
353 /export/build1/LYNXOS_500/build/lynxos/120604-C/x86/lib/libnsl.a(getpwent.as.o):
354 In function `getpw':
355 getpwent.as.o(.text+0x29e): undefined reference to `atoi'
356 /export/build1/LYNXOS_500/build/lynxos/120604-C/x86/lib/libnsl.a(getpwent.as.o)(
357 .text+0x34c): more undefined references to `atoi' follow
358 collect2: ld returned 1 exit status
359 make[4]: *** [named] Error 1
360 <pre>
361 </div>
362
363 <p>It seems that the problem is in strtol.c version 10.2, which says that the definition was moved to stdlib.h, and stdlib.h appears to have it, yet the build fails anyway...</p>
364
365 <p>Looking at the compilation line for strtol.c I see it produces strtol.as.o, which in a previous successful build yeilds:</p>
366
367 <div class="code">
368 <pre>
369 $ nm strtol.as.o
370         U __ctype
371         U __divdi3
372         U __moddi3
373         U _errno
374 00000208 T atoi
375 000001f4 T atol
376 00000000 T strtol
377 </pre>
378 </div>
379
380 <p>But in this build yeilds:</p>
381
382 <div class="code">
383 <pre>
384 $ nm strtol.as.o
385         U __ctype
386         U __divdi3
387         U __moddi3
388         U _errno
389 00000208 T atoi
390 000001f4 T atol
391 00000000 T strtol
392 </pre>
393 </div>
394
395 <p>So how do we fix this error?</p>
396                               
397                               <p class="entry-footer">
398                                  <span class="post-footers">Posted by  at 11:03 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000269.html">Permalink</a>
399                                  
400                                  
401                               </p>
402                            </div>
403                         </div>
404                      </div>
405                      
406                      
407
408                      <h2 class="date-header">January  3, 2005</h2>
409                      <a id="a000268"></a>
410                      <div class="entry" id="entry-268">
411                         <h3 class="entry-header">files4ecr.pl/Building TOT as per instructions</h3>
412                         <div class="entry-content">
413                            <div class="entry-body">
414                               <ul>
415
416 <li>Worked on getting files4ecr.pl to work</li>
417
418 <li>Attempted to rebuild TOT using the documentation created so far as a guide. Ran out of disk space! :-(</li>
419
420 <li>More documentation of build/test/release process</li>
421
422 </ul>
423                               
424                               <h3>files4ecr.pl</h3>
425
426 <p>The daily CVS Checkin Log works by creating a temporary CVS area based on a tag then doing a cvs update capturing what files have changed. Those files are examined and a report is produced by ECR number.</p>
427
428 <p>While this works fairly well and is relatively optimized (only working on the files that changed since the label) it may not be that accurate. It seems to assume that all files for an ECR are checked in together and on the same day. What if, for example, somebody checked in a file for an ECR days ago and it now checking in the rest of the work? The files reported for this ECR may  be incomplete.</p>
429
430 <p>Here's an example of where this happened. In today's CVS Checkin Log email the following files are listed as associated with ECR # 20591:<p>
431
432 <pre>
433 ECR Number:  20591
434         src/lib/libc/strto_int.c              10.2      zhuravle        2004/12/27 16:11:21
435         src/lib/libc/strto_real.c             10.2      zhuravle        2004/12/27 16:09:47
436         src/lib/libc/strto_real.h             10.2      zhuravle        2004/12/27 16:09:47
437         src/lib/libc/strtod.c                 10.4      zhuravle        2004/12/27 16:09:47
438         src/lib/libc/strtof.c                 10.2      zhuravle        2004/12/27 16:09:47
439         src/lib/libc/strtoimax.c              10.2      zhuravle        2004/12/27 16:11:58
440         src/lib/libc/strtol.c                 10.2      zhuravle        2004/12/27 16:11:58
441         src/lib/libc/strtold.c                10.2      zhuravle        2004/12/27 16:09:48
442         src/lib/libc/strtoll.c                10.3      zhuravle        2004/12/27 16:11:58
443         src/lib/libc/strtoul.c                10.2      zhuravle        2004/12/27 16:11:58
444         src/lib/libc/strtoull.c               10.3      zhuravle        2004/12/27 16:11:58
445         src/lib/libc/strtoumax.c              10.2      zhuravle        2004/12/27 16:11:58
446         usr/include/rcsid.h                   10.2      zhuravle        2004/12/27 15:57:50
447         usr/include/stdlib.h                  10.10     zhuravle        2004/12/27 16:07:26
448 </pre>
449
450 <p>Yet thoroughly scanning the CVS logs we find:</p>
451
452 <pre>
453 ECR Number: 20591 Nbr of files: 25
454
455 Nbr Path/File                           Version   Author    Date
456 --- ----------------------------------- ------- ----------- -------------------
457   1 strtoull.c                           10.3   zhuravle    2004/12/27 16:11:58
458   2 strtoull.c                           10.2   zhuravle    2004/10/22 12:04:48
459   3 Makefile                             10.18  zhuravle    2004/10/22 12:04:47
460   4 strto_int.c                          10.2   zhuravle    2004/12/27 16:11:21
461   5 strto_int.c                          10.1   zhuravle    2004/10/22 12:04:48
462   6 strtold.c                            10.2   zhuravle    2004/12/27 16:09:48
463   7 strtold.c                            10.1   zhuravle    2004/10/22 12:04:48
464   8 strtoll.c                            10.3   zhuravle    2004/12/27 16:11:58
465   9 strtoll.c                            10.2   zhuravle    2004/10/22 12:04:48
466  10 strtoul.c                            10.2   zhuravle    2004/12/27 16:11:58
467  11 strtoul.c                            10.1   zhuravle    2004/10/22 12:04:48
468  12 strtoimax.c                          10.2   zhuravle    2004/12/27 16:11:58
469  13 strtoimax.c                          10.1   zhuravle    2004/10/22 12:04:48
470  14 strtoumax.c                          10.2   zhuravle    2004/12/27 16:11:58
471  15 strtoumax.c                          10.1   zhuravle    2004/10/22 12:04:48
472  16 strto_real.c                         10.2   zhuravle    2004/12/27 16:09:47
473  17 strto_real.c                         10.1   zhuravle    2004/10/22 12:04:48
474  18 strto_real.h                         10.2   zhuravle    2004/12/27 16:09:47
475  19 strto_real.h                         10.1   zhuravle    2004/10/22 12:04:48
476  20 strtod.c                             10.4   zhuravle    2004/12/27 16:09:47
477  21 strtod.c                             10.3   zhuravle    2004/10/22 12:04:48
478  22 strtof.c                             10.2   zhuravle    2004/12/27 16:09:47
479  23 strtof.c                             10.1   zhuravle    2004/10/22 12:04:48
480  24 strtol.c                             10.2   zhuravle    2004/12/27 16:11:58
481  25 strtol.c                             10.1   zhuravle    2004/10/22 12:04:48
482
483 </pre>
484
485 <p>Now files4ecr.pl thoroughly checks all CVS logs (based on the paths it is givin that is) but this takes a <b>lot</b> of time.</p>
486
487 <p>Note that Makefile is listed by files4ecr.pl but not in the daily CVS Checking Log. That's because Makefile was checked in with that ECR number a while ago. The daily CVS Checkin Log does not reflect this historical fact.</p>
488
489 <p>Also note that ECR's unlike tags that can only exist on one revision, ECR numbers are just strings placed in the check in comment. Thus there is the possibility that they will exist on more than one revision (e.g. strtod.c versions 10.4 and 10.3). IOW checking in another version of a file and using the same ECR number will not remove the ECR number in the command of a previous version of the file!</p>
490                               
491                               <p class="entry-footer">
492                                  <span class="post-footers">Posted by  at 11:18 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000268.html">Permalink</a>
493                                  
494                                  
495                               </p>
496                            </div>
497                         </div>
498                      </div>
499                      
500                   </div>
501                </div>
502             </div>
503          </div>
504       </div>
505    </div>
506 </body>
507 </html>