[Piglit] piglit-summary-html.py currently broken

Thomas Wood thomas.wood at intel.com
Tue Jun 17 03:26:11 PDT 2014


On 17 June 2014 00:51, Ian Romanick <idr at freedesktop.org> wrote:
> On 06/16/2014 02:19 PM, Dylan Baker wrote:
>> On Monday, June 16, 2014 12:32:35 PM Ian Romanick wrote:
>>> When I run piglit-summary-html.py, it crashes with the following trace:
>>>
>>> Traceback (most recent call last):
>>>   File "./piglit-summary-html.py", line 28, in <module>
>>>     html(sys.argv[1:])
>>>   File "/home/idr/devel/graphics/piglit/framework/programs/summary.py", line
>>> 97, in html output.generate_html(args.summaryDir, args.exclude_details)
>>>   File "/home/idr/devel/graphics/piglit/framework/summary.py", line 436, in
>>> generate_html module_directory=self.TEMP_DIR)
>>>   File "/usr/lib/python2.7/site-packages/mako/template.py", line 224, in
>>> __init__ module = self._compile_from_file(path, filename)
>>>   File "/usr/lib/python2.7/site-packages/mako/template.py", line 250, in
>>> _compile_from_file path)
>>>   File "/usr/lib/python2.7/site-packages/mako/template.py", line 513, in
>>> _compile_module_file node = lexer.parse()
>>>   File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 211, in parse
>>>     if self.match_control_line():
>>>   File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 400, in
>>> match_control_line self.append_node(parsetree.ControlLine, keyword, isend,
>>> text)
>>>   File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 125, in
>>> append_node node = nodecls(*args, **kwargs)
>>>   File "/usr/lib/python2.7/site-packages/mako/parsetree.py", line 72, in
>>> __init__ code = ast.PythonFragment(text, **self.exception_kwargs)
>>>   File "/usr/lib/python2.7/site-packages/mako/ast.py", line 90, in __init__
>>>     super(PythonFragment, self).__init__(code, **exception_kwargs)
>>>   File "/usr/lib/python2.7/site-packages/mako/ast.py", line 39, in __init__
>>>     f.visit(expr)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 279, in
>>> visit return self.generic_visit(node)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 287, in
>>> generic_visit self.visit(item)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 278, in
>>> visit return f(node)
>>>   File "/usr/lib/python2.7/site-packages/mako/pyparser.py", line 143, in
>>> visit_For self.visit(node.iter)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 279, in
>>> visit return self.generic_visit(node)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 287, in
>>> generic_visit self.visit(item)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 279, in
>>> visit return self.generic_visit(node)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 289, in
>>> generic_visit self.visit(value)
>>>   File "/usr/lib/python2.7/site-packages/mako/_ast_util.py", line 278, in
>>> visit return f(node)
>>>   File "/usr/lib/python2.7/site-packages/mako/pyparser.py", line 107, in
>>> visit_Lambda self._visit_function(node, True)
>>>   File "/usr/lib/python2.7/site-packages/mako/pyparser.py", line 125, in
>>> _visit_function if arg_id(arg) in self.local_ident_stack:
>>> AttributeError: 'Tuple' object has no attribute 'id'
>>>
>>> I bisected this to the following commit:
>>>
>>> commit 6755d9195bc05bbee2445eeac6af6b0e0ecf5160
>>> Author: Thomas Wood <thomas.wood at intel.com>
>>> Date:   Wed Jun 4 11:07:30 2014 +0100
>>>
>>>     templates: add the totals to testrun_info
>>>
>>>     Add the totals to the testrun_info template, including the total number
>>>     of tests evaluated.
>>>
>>>     Signed-off-by: Thomas Wood <thomas.wood at intel.com>
>>>     Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>
>>
>> I cannot replicate this bug, can you upload your results files somewhere or
>> send them to me?
>
> http://people.freedesktop.org/~idr/10.2-12/
>
> I'm suspicious that it depends on some software versions.  I've got:
>
> python-2.7.3-13.fc18.x86_64
> python-mako-0.5.0-5.fc18.noarch
>
> Are other things important?
>

I recently encountered this problem on a machine using Mako 0.5 and
came across the following bug report:

https://bitbucket.org/zzzeek/mako/issue/201/

Installing a newer version of Mako (1.0.0) fixed the problem. Version
0.7.3 available in Fedora 20 also doesn't have this issue.

The bug report suggests the issue is present in Mako 0.7.2, so perhaps
the following version check should be added to summary.py:

diff --git a/framework/summary.py b/framework/summary.py
index e5eb156..bf63777 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -29,8 +29,15 @@ import collections
 import tempfile
 import datetime
 import re
+from distutils.version import LooseVersion
+import mako
 from mako.template import Template

+if LooseVersion(mako.__version__) < '0.7.3':
+    print("Please install Mako >= 0.7.3")
+    exit(1)
+
+
 # a local variable status exists, prevent accidental overloading by renaming
 # the module
 import framework.status as so


More information about the Piglit mailing list