@@ -98,6 +98,9 @@ def get_errors_from_file(htmlpath):
98
98
# <tr><td>Function:</td> <td><b>init_gst</b></td></tr>
99
99
# <tr><td>Error:</td> <td><b>ob_refcnt of new ref from (unknown) pygobject_init is 1 too high</b></td></tr>
100
100
# </table>
101
+ if not soup .html :
102
+ # broken file: error during output of HTML?
103
+ return
101
104
for div in soup .html .body .findAll ('div' ):
102
105
table = div .table
103
106
if not table :
@@ -109,11 +112,15 @@ def get_second_col(row):
109
112
return row ('td' )[1 ].b .string
110
113
# Capture the marked up source code and notes from the report:
111
114
htmlpre = div .div .pre
115
+
116
+ errmsg = get_second_col (rows [2 ])
117
+ if not errmsg :
118
+ continue
112
119
yield ErrorReport (htmlpath = htmlpath ,
113
120
htmlid = div ['id' ],
114
121
filename = get_second_col (rows [0 ]),
115
122
function = get_second_col (rows [1 ]),
116
- errmsg = get_second_col ( rows [ 2 ]) ,
123
+ errmsg = errmsg ,
117
124
htmlpre = htmlpre )
118
125
119
126
class Severity (namedtuple ('Severity' , ('priority' , 'title' , 'description' ))):
@@ -151,6 +158,14 @@ def _classify_segfault(self, report):
151
158
description = '<p>Code paths that will lead to a segmentatation fault</p>' )
152
159
153
160
def classify (self , report ):
161
+ #print('report: %r' % (dir(report), ))
162
+ #print('report.errmsg: %r' % report.errmsg)
163
+ if report .errmsg is None :
164
+ return Severity (priority = PRIORITY__UNCLASSIFIED ,
165
+ title = 'Unclassified errors' ,
166
+ description = '''
167
+ <p>The triager didn't know how to classify these ones</p>
168
+ ''' )
154
169
m = re .match ('ob_refcnt of (.+) too high' , report .errmsg )
155
170
if m :
156
171
if report .might_be_borrowed_ref ():
@@ -241,6 +256,8 @@ class BuildLog:
241
256
def __init__ (self , path ):
242
257
self .unimplemented_functions = set ()
243
258
self .cplusplus_failure = False
259
+ self .seen_rpmbuild = False
260
+ self .num_tracebacks = 0
244
261
245
262
buildlog = os .path .join (path , 'build.log' )
246
263
with open (buildlog ) as f :
@@ -252,11 +269,54 @@ def __init__(self, path):
252
269
if m :
253
270
self .unimplemented_functions .add (m .group (1 ))
254
271
255
- if "AttributeError: 'NoneType' object has no attribute 'vars'" in line :
256
- self .cplusplus_failure = True
272
+ # Am seeing errors of this form:
273
+ # The C++ compiler "/usr/bin/c++" is not able to compile a simple test
274
+ # program.
275
+ # It fails with the following output:
276
+ # Change Dir: /builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp
277
+ #
278
+ # Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
279
+ # /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
280
+ # CMakeFiles/cmTryCompileExec.dir/build
281
+ # gmake[1]: Entering directory
282
+ # `/builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp'
283
+ # /usr/bin/cmake -E cmake_progress_report
284
+ # /builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp/CMakeFiles 1
285
+ # Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o
286
+ # /usr/bin/c++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
287
+ # -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o
288
+ # CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o -c
289
+ # /builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
290
+ # Traceback (most recent call last):
291
+ # File "/usr/bin/the-real-g++", line 53, in <module>
292
+ # p = subprocess.Popen(args)
293
+ # File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__
294
+ # errread, errwrite)
295
+ # File "/usr/lib64/python2.7/subprocess.py", line 1130, in _execute_child
296
+ # self.pid = os.fork()
297
+ # OSError: [Errno 11] Resource temporarily unavailable
298
+ if 'The C++ compiler "/usr/bin/c++" is not able to compile a simple test' in line :
299
+ self .cplusplus_failure = 'The C++ compiler "/usr/bin/c++" is not able to compile a simple test'
300
+
301
+ if not self .cplusplus_failure :
302
+ if 'OSError: [Errno 11] Resource temporarily unavailable' in line :
303
+ self .cplusplus_failure = 'OSError: [Errno 11] Resource temporarily unavailable'
304
+
305
+ if 'configure: error: C++ compiler cannot create executables' in line :
306
+ self .cplusplus_failure = 'configure: error: C++ compiler cannot create executables'
307
+
308
+ if 'rpmbuild -bb' in line :
309
+ self .seen_rpmbuild = True
310
+
311
+ if line .startswith ('Traceback ' ):
312
+ self .num_tracebacks += 1
257
313
258
314
class Index :
259
315
def __init__ (self , path , title ):
316
+ self .reported = False
317
+ self .seen_SWIG = False
318
+ self .seen_Cython = False
319
+
260
320
outpath = os .path .join (path , 'index.html' )
261
321
with open (outpath , 'w' ) as f :
262
322
f .write ('<html><head><title>%s</title></head>\n ' % title )
@@ -269,9 +329,18 @@ def __init__(self, path, title):
269
329
buildlog = BuildLog (path )
270
330
271
331
if buildlog .cplusplus_failure :
272
- f .write (' <p>C++ failure</p>\n ' )
332
+ f .write (' <p>C++ failure: %s </p>\n ' % buildlog . cplusplus_failure )
273
333
srpm = Srpm .from_path (path )
274
- BugReportDb .add_status (srpm , "FIXME: C++" )
334
+ BugReportDb .add_status (srpm , "FIXME: C++ failure: %s" % buildlog .cplusplus_failure )
335
+ self .reported = True
336
+ """
337
+ if not buildlog.seen_rpmbuild:
338
+ f.write(' <p>Did not see rpmbuild -bb in build.log</p>\n ')
339
+ srpm = Srpm.from_path(path)
340
+ BugReportDb.add_status(srpm, "FIXME: did not see rpmbuild -bb in build.log")
341
+ self.reported = True
342
+ return
343
+ """
275
344
276
345
# Gather the ErrorReport by severity
277
346
triager = Triager ()
@@ -287,6 +356,8 @@ def __init__(self, path, title):
287
356
#print ' ', os.path.join(dirpath, filename)
288
357
htmlpath = os .path .join (dirpath , filename )
289
358
for er in get_errors_from_file (htmlpath ):
359
+ if er is None :
360
+ continue
290
361
#print(er.filename)
291
362
#print(er.function)
292
363
#print(er.errmsg)
@@ -310,6 +381,12 @@ def __init__(self, path, title):
310
381
href , er .errmsg ))
311
382
f .write (' </table>\n ' )
312
383
384
+ if 'SWIG' in er .function or 'SWIG' in er .errmsg :
385
+ self .seen_SWIG = True
386
+
387
+ if '__pyx' in er .function or '__pyx' in er .errmsg :
388
+ self .seen_Cython = True
389
+
313
390
if buildlog .unimplemented_functions :
314
391
f .write (' <h2>Implementation notes for gcc-with-cpychecker</h2>\n ' )
315
392
f .write (' <p>The following "Py" functions were used but aren\' t\n '
@@ -325,6 +402,26 @@ def __init__(self, path, title):
325
402
f .write (' </body>\n ' )
326
403
f .write ('</html>\n ' )
327
404
405
+ if self .seen_Cython :
406
+ if not self .reported :
407
+ srpm = Srpm .from_path (path )
408
+ BugReportDb .add_status (srpm , "FIXME: Cython-built" )
409
+ self .reported = True
410
+
411
+ if self .seen_SWIG :
412
+ if not self .reported :
413
+ srpm = Srpm .from_path (path )
414
+ BugReportDb .add_status (srpm , "FIXME: SWIG-built" )
415
+ self .reported = True
416
+
417
+ if buildlog .num_tracebacks >= 5 :
418
+ if not self .reported :
419
+ srpm = Srpm .from_path (path )
420
+ BugReportDb .add_status (srpm ,
421
+ ("FIXME: %i tracebacks during build"
422
+ % buildlog .num_tracebacks ))
423
+ self .reported = True
424
+
328
425
def iter_severities (self ):
329
426
for sev in sorted (self .severities .keys ())[::- 1 ]:
330
427
yield sev , self .severities [sev ]
0 commit comments