[gcc-python-plugin] rename test cases to fix issues with checkouts on OS X case-insensitive filesystems
by David Hugh Malcolm
commit 6990bfc9d5aa6c425e65abea7f257839cc021641
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Apr 9 20:04:44 2012 -0400
rename test cases to fix issues with checkouts on OS X case-insensitive filesystems
tests/cpychecker/Py_BuildValue/code_d -> tests/cpychecker/Py_BuildValue/code_lower_d
tests/cpychecker/Py_BuildValue/code_D -> tests/cpychecker/Py_BuildValue/code_upper_D
.../Py_BuildValue/code_D/incorrect/stderr.txt | 7 -------
.../{code_d => code_lower_d}/correct/input.c | 0
.../{code_D => code_lower_d}/correct/script.py | 0
.../{code_D => code_upper_D}/correct/input.c | 0
.../incorrect => code_upper_D/correct}/script.py | 0
.../{code_D => code_upper_D}/incorrect/input.c | 0
.../incorrect/metadata.ini | 0
.../correct => code_upper_D/incorrect}/script.py | 0
.../code_upper_D/incorrect/stderr.txt | 7 +++++++
9 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tests/cpychecker/Py_BuildValue/code_d/correct/input.c b/tests/cpychecker/Py_BuildValue/code_lower_d/correct/input.c
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_d/correct/input.c
rename to tests/cpychecker/Py_BuildValue/code_lower_d/correct/input.c
diff --git a/tests/cpychecker/Py_BuildValue/code_D/correct/script.py b/tests/cpychecker/Py_BuildValue/code_lower_d/correct/script.py
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_D/correct/script.py
rename to tests/cpychecker/Py_BuildValue/code_lower_d/correct/script.py
diff --git a/tests/cpychecker/Py_BuildValue/code_D/correct/input.c b/tests/cpychecker/Py_BuildValue/code_upper_D/correct/input.c
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_D/correct/input.c
rename to tests/cpychecker/Py_BuildValue/code_upper_D/correct/input.c
diff --git a/tests/cpychecker/Py_BuildValue/code_D/incorrect/script.py b/tests/cpychecker/Py_BuildValue/code_upper_D/correct/script.py
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_D/incorrect/script.py
rename to tests/cpychecker/Py_BuildValue/code_upper_D/correct/script.py
diff --git a/tests/cpychecker/Py_BuildValue/code_D/incorrect/input.c b/tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/input.c
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_D/incorrect/input.c
rename to tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/input.c
diff --git a/tests/cpychecker/Py_BuildValue/code_D/incorrect/metadata.ini b/tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/metadata.ini
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_D/incorrect/metadata.ini
rename to tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/metadata.ini
diff --git a/tests/cpychecker/Py_BuildValue/code_d/correct/script.py b/tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/script.py
similarity index 100%
rename from tests/cpychecker/Py_BuildValue/code_d/correct/script.py
rename to tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/script.py
diff --git a/tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/stderr.txt b/tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/stderr.txt
new file mode 100644
index 0000000..7a55c87
--- /dev/null
+++ b/tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/stderr.txt
@@ -0,0 +1,7 @@
+tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/input.c: In function 'test':
+tests/cpychecker/Py_BuildValue/code_upper_D/incorrect/input.c:25:nn: warning: Mismatching type in call to Py_BuildValue with format code "D" [enabled by default]
+ argument 2 ("d") had type
+ "double"
+ but was expecting
+ "struct Py_complex *"
+ for format code "D"
12 years, 1 month
[gcc-python-plugin: 5/5] Merge pull request #3 from kevin-dot-pyle/master
by David Hugh Malcolm
commit 0623e114b4a15e6bf397424b1bdef0a03bc0eeab
Merge: 7b1f523 e5f21c2
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Apr 9 16:35:07 2012 -0700
Merge pull request #3 from kevin-dot-pyle/master
Minor build system improvements
Makefile | 2 +-
gccutils.py | 42 ++++++++++++
generate-config-h.py | 7 ++-
libcpychecker/html/make_html.py | 4 +-
misc/fedora/makeindex.py | 2 +-
tests/gccutils/topological-sort/input.c | 95 ++++++++++++++++++++++++++++
tests/gccutils/topological-sort/script.py | 29 +++++++++
tests/gccutils/topological-sort/stdout.txt | 10 +++
8 files changed, 186 insertions(+), 5 deletions(-)
---
12 years, 1 month
[gcc-python-plugin: 4/5] Python3: libcpychecker: fix print-as-function SyntaxError
by David Hugh Malcolm
commit e5f21c296b8742f817d8deb5123b4583b8d931d8
Author: Kevin Pyle <gcc-python-plugin.8eaf7cd8e5128d8191fe(a)spamgourmet.com>
Date: Sun Apr 8 17:19:11 2012 -0500
Python3: libcpychecker: fix print-as-function SyntaxError
libcpychecker/html/make_html.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libcpychecker/html/make_html.py b/libcpychecker/html/make_html.py
index 6ca13b8..e3ec3b5 100755
--- a/libcpychecker/html/make_html.py
+++ b/libcpychecker/html/make_html.py
@@ -273,7 +273,7 @@ def main(argv):
return "Please provide code and json filenames."
codefile = open(argv[1])
jsonfile = open(argv[2])
- print HtmlPage(codefile, jsonfile)
+ print(HtmlPage(codefile, jsonfile))
if __name__ == '__main__':
from sys import argv as ARGV
12 years, 1 month
[gcc-python-plugin: 3/5] Python3: libcpychecker: fix Unicode string SyntaxError
by David Hugh Malcolm
commit 41832b294c758cd7fc7f3a58a69e38b8cf451971
Author: Kevin Pyle <gcc-python-plugin.8eaf7cd8e5128d8191fe(a)spamgourmet.com>
Date: Sun Apr 8 17:17:24 2012 -0500
Python3: libcpychecker: fix Unicode string SyntaxError
libcpychecker/html/make_html.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libcpychecker/html/make_html.py b/libcpychecker/html/make_html.py
index e26de59..6ca13b8 100755
--- a/libcpychecker/html/make_html.py
+++ b/libcpychecker/html/make_html.py
@@ -161,7 +161,7 @@ class HtmlPage(object):
"""make the footer"""
return E.E.footer(
E.ATTR(id='footer'),
- E.P(u' \xa0|\xa0 '.join((
+ E.P(' | '.join((
'Hackathon 7.0',
'Buck G, Alex M, Jason M',
'Yelp HQ 2012',
12 years, 1 month
[gcc-python-plugin: 2/5] Python3: makeindex.py: fix print-as-function SyntaxError
by David Hugh Malcolm
commit 0659cbb708be4ea8ab18a1e787b287d5d93a8cd9
Author: Kevin Pyle <gcc-python-plugin.8eaf7cd8e5128d8191fe(a)spamgourmet.com>
Date: Sun Apr 8 17:16:59 2012 -0500
Python3: makeindex.py: fix print-as-function SyntaxError
misc/fedora/makeindex.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/misc/fedora/makeindex.py b/misc/fedora/makeindex.py
index 92ff5cb..b227c44 100644
--- a/misc/fedora/makeindex.py
+++ b/misc/fedora/makeindex.py
@@ -263,7 +263,7 @@ class BuildLog:
with open(buildlog) as f:
for line in f.readlines():
if 0:
- print repr(line)
+ print(repr(line))
m = re.match('NotImplementedError: not yet implemented: (\S+)',
line)
if m:
12 years, 1 month
[gcc-python-plugin: 1/5] Build: generate-config-h.py: reuse plugindir from Makefile
by David Hugh Malcolm
commit 4ac3e559972b91fc1d5a9941adbc92d4c7e77172
Author: Kevin Pyle <gcc-python-plugin.8eaf7cd8e5128d8191fe(a)spamgourmet.com>
Date: Sun Apr 8 14:08:42 2012 -0500
Build: generate-config-h.py: reuse plugindir from Makefile
The Makefile already computes the gcc plugin directory. Reuse that
instead of computing it again.
Makefile | 2 +-
generate-config-h.py | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/Makefile b/Makefile
index ba0a48a..7468de3 100644
--- a/Makefile
+++ b/Makefile
@@ -129,7 +129,7 @@ clean:
$(RM) -r docs/_build
autogenerated-config.h: $(addprefix $(srcdir),generate-config-h.py configbuilder.py)
- $(PYTHON) $< -o $@ --gcc=$(CC)
+ $(PYTHON) $< -o $@ --gcc="$(CC)" --plugindir="$(GCCPLUGINS_DIR)"
autogenerated-%.txt: $(srcdir)%.txt.in
$(CPP) $(CPPFLAGS) -x c-header $^ -o $@
diff --git a/generate-config-h.py b/generate-config-h.py
index bca18d0..7d86f30 100644
--- a/generate-config-h.py
+++ b/generate-config-h.py
@@ -25,13 +25,18 @@ class GccPythonPluginConfigBuilder(ConfigBuilder):
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--gcc')
+ parser.add_argument('--plugindir')
args, argv = parser.parse_known_args(argv)
ConfigBuilder.__init__(self, argv)
self.gcc = args.gcc
+ self.plugindir = args.plugindir
def main(self):
prefix = 'GCC_PYTHON_PLUGIN_CONFIG_'
- plugindir = self.capture_shell_output('locating plugin directory for %s' % self.gcc,
+ if self.plugindir:
+ plugindir = self.plugindir
+ else:
+ plugindir = self.capture_shell_output('locating plugin directory for %s' % self.gcc,
'%s --print-file-name=plugin' % self.gcc).strip()
extraargs = ['-I%s' % os.path.join(plugindir, 'include')]
self.test_for_mandatory_c_header('gcc-plugin.h', extraargs)
12 years, 1 month
[gcc-python-plugin] (5 commits) ...Merge pull request #3 from kevin-dot-pyle/master
by David Hugh Malcolm
Summary of changes:
4ac3e55... Build: generate-config-h.py: reuse plugindir from Makefile
0659cbb... Python3: makeindex.py: fix print-as-function SyntaxError
41832b2... Python3: libcpychecker: fix Unicode string SyntaxError
e5f21c2... Python3: libcpychecker: fix print-as-function SyntaxError
0623e11... Merge pull request #3 from kevin-dot-pyle/master
12 years, 1 month
[gcc-python-plugin] add gccutils.sorted_callgraph() to get callgraph in topologically-sorted order
by David Hugh Malcolm
commit 600060c87165585bc6d07be0cf85ac049cff1630
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Apr 5 14:50:22 2012 -0400
add gccutils.sorted_callgraph() to get callgraph in topologically-sorted order
gccutils.py | 42 ++++++++++++
tests/gccutils/topological-sort/input.c | 95 ++++++++++++++++++++++++++++
tests/gccutils/topological-sort/script.py | 29 +++++++++
tests/gccutils/topological-sort/stdout.txt | 10 +++
4 files changed, 176 insertions(+), 0 deletions(-)
---
diff --git a/gccutils.py b/gccutils.py
index 43304c5..8e18077 100644
--- a/gccutils.py
+++ b/gccutils.py
@@ -634,3 +634,45 @@ def check_isinstance(obj, types):
"""
if not isinstance(obj, types):
raise TypeError('%s / %r is not an instance of %s' % (obj, obj, types))
+
+def sorted_callgraph():
+ """
+ Return the callgraph, in topologically-sorted order
+ """
+ return topological_sort(gcc.get_callgraph_nodes(),
+ get_srcs=lambda n: [edge.caller
+ for edge in n.callers
+ # Strip out recursive calls:
+ if edge.caller != n],
+ get_dsts=lambda n: [edge.callee
+ for edge in n.callees
+ # Strip out recursive calls:
+ if edge.callee != n])
+
+def topological_sort(nodes, get_srcs, get_dsts):
+ """
+ Topological sort in O(n), based on depth-first traversal
+ """
+ result = []
+ visited = set()
+ debug = False
+ def visit(n):
+ if n not in visited:
+ if debug:
+ print('first visit to %s' % n.decl)
+ visited.add(n)
+ for m in get_srcs(n):
+ visit(m)
+ if debug:
+ print('adding to result: %s' % n.decl)
+ result.append(n)
+ else:
+ if debug:
+ print('already visited %s' % n.decl)
+
+ for n in nodes:
+ if not get_dsts(n):
+ visit(n)
+
+ return result
+
diff --git a/tests/gccutils/topological-sort/input.c b/tests/gccutils/topological-sort/input.c
new file mode 100644
index 0000000..bb05b35
--- /dev/null
+++ b/tests/gccutils/topological-sort/input.c
@@ -0,0 +1,95 @@
+/*
+ Copyright 2012 David Malcolm <dmalcolm(a)redhat.com>
+ Copyright 2012 Red Hat, Inc.
+
+ This is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+/*
+ Verify that the topological sort code in gccutils works
+*/
+
+int a(int);
+int b(int);
+int c(int);
+int d(int);
+int e(int);
+int f(int);
+int g(int);
+int h(int);
+int j(int);
+int k(int);
+
+int a(int i)
+{
+ return e(i) + c(i);
+}
+
+int b(int i)
+{
+ return 42 - i;
+}
+
+int c(int i)
+{
+ return i * i;
+}
+
+int d(int i)
+{
+ return a(i) + b(c(i));
+}
+
+/* Directly recursive (actually factorial) */
+int e(int i)
+{
+ if (i>1) {
+ return i * e(i-1);
+ } else {
+ return 1;
+ }
+}
+
+/* f and g are mutually recursive */
+int f(int i)
+{
+ return g(i) + b(i);
+}
+
+int g(int i)
+{
+ return f(i) + c(i) + k(i);
+}
+
+/* h is entirely disjoint from the rest of the graph */
+int h(int i)
+{
+ return i;
+}
+
+int j(int i)
+{
+ return 2 * f(i);
+}
+
+/* k is not defined */
+
+/*
+ PEP-7
+Local variables:
+c-basic-offset: 4
+indent-tabs-mode: nil
+End:
+*/
diff --git a/tests/gccutils/topological-sort/script.py b/tests/gccutils/topological-sort/script.py
new file mode 100644
index 0000000..ba4444b
--- /dev/null
+++ b/tests/gccutils/topological-sort/script.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+# Copyright 2012 David Malcolm <dmalcolm(a)redhat.com>
+# Copyright 2012 Red Hat, Inc.
+#
+# This is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+# Verify that the topological sort code in gccutils works
+import gcc
+
+def on_pass_execution(p, fn):
+ if p.name == '*free_lang_data':
+ from gccutils import sorted_callgraph
+ for cgn in sorted_callgraph():
+ print(cgn.decl)
+
+gcc.register_callback(gcc.PLUGIN_PASS_EXECUTION,
+ on_pass_execution)
diff --git a/tests/gccutils/topological-sort/stdout.txt b/tests/gccutils/topological-sort/stdout.txt
new file mode 100644
index 0000000..511c855
--- /dev/null
+++ b/tests/gccutils/topological-sort/stdout.txt
@@ -0,0 +1,10 @@
+j
+f
+g
+k
+h
+d
+a
+e
+c
+b
12 years, 1 month
[gcc-python-plugin] fix a crash when adding a pass with an incorrect keyword argument
by David Hugh Malcolm
commit 7b1f5230605d5945d4930185c94f5bfb8aae996d
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Apr 5 12:21:15 2012 -0400
fix a crash when adding a pass with an incorrect keyword argument
The assert:
assert(obj->wr_prev);
within gcc_python_wrapper_untrack() could fail when cleaning up a
partially-constructed object that never made it onto the list.
Bulletproof the function against such __init__ failures.
gcc-python-wrapper.c | 27 ++++++++++++++++++---------
tests/plugin/new-passes/script.py | 11 +++++++++++
2 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/gcc-python-wrapper.c b/gcc-python-wrapper.c
index fd06f7f..93feb58 100644
--- a/gcc-python-wrapper.c
+++ b/gcc-python-wrapper.c
@@ -206,16 +206,25 @@ gcc_python_wrapper_untrack(struct PyGccWrapper *obj)
assert(obj);
assert(Py_REFCNT(obj) == 0);
- assert(sentinel.wr_next);
- assert(sentinel.wr_prev);
- assert(obj->wr_prev);
- assert(obj->wr_next);
- /* Remove from linked list: */
- obj->wr_prev->wr_next = obj->wr_next;
- obj->wr_next->wr_prev = obj->wr_prev;
- obj->wr_prev = NULL;
- obj->wr_next = NULL;
+ /*
+ Remove from the linked list if it's within it
+
+ (If the object constructor fails, then we have only a
+ partially-constructed object, which might not have been
+ added to the linked list yet)
+ */
+ if (obj->wr_prev) {
+ assert(sentinel.wr_next);
+ assert(sentinel.wr_prev);
+ assert(obj->wr_next);
+
+ /* Remove from linked list: */
+ obj->wr_prev->wr_next = obj->wr_next;
+ obj->wr_next->wr_prev = obj->wr_prev;
+ obj->wr_prev = NULL;
+ obj->wr_next = NULL;
+ }
}
void
diff --git a/tests/plugin/new-passes/script.py b/tests/plugin/new-passes/script.py
index 6a0e10b..488966c 100644
--- a/tests/plugin/new-passes/script.py
+++ b/tests/plugin/new-passes/script.py
@@ -130,3 +130,14 @@ class GimplePassSettingLocation(gcc.GimplePass):
ps = GimplePassSettingLocation(name='gimple-pass-setting-location')
print('registering: %r' % ps)
ps.register_after('cfg')
+
+# Verify that the plugin doesn't crash when constructing a pass with
+# an unrecognized kwarg:
+class TestBogusKwargs(gcc.GimplePass):
+ def __init__(self):
+ gcc.GimplePass.__init__(self, 'test-bogus-kwargs')
+
+try:
+ ps = TestBogusKwargs(this_is_not_a_valid_kwarg=42)
+except:
+ pass
12 years, 1 month
[gcc-python-plugin] misc/fedora: various hacks to get the mass rebuilds working
by David Hugh Malcolm
commit 26b13167de26ef54c7a7a0df805cc8e193583cc6
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Apr 4 15:42:12 2012 -0400
misc/fedora: various hacks to get the mass rebuilds working
misc/fedora/makeindex.py | 107 +++++++++++++++++++++++++++++++++++++++++--
misc/fedora/mass-rebuild.py | 35 ++++++++++++--
2 files changed, 133 insertions(+), 9 deletions(-)
---
diff --git a/misc/fedora/makeindex.py b/misc/fedora/makeindex.py
index a1b888f..92ff5cb 100644
--- a/misc/fedora/makeindex.py
+++ b/misc/fedora/makeindex.py
@@ -98,6 +98,9 @@ def get_errors_from_file(htmlpath):
# <tr><td>Function:</td> <td><b>init_gst</b></td></tr>
# <tr><td>Error:</td> <td><b>ob_refcnt of new ref from (unknown) pygobject_init is 1 too high</b></td></tr>
# </table>
+ if not soup.html:
+ # broken file: error during output of HTML?
+ return
for div in soup.html.body.findAll('div'):
table = div.table
if not table:
@@ -109,11 +112,15 @@ def get_errors_from_file(htmlpath):
return row('td')[1].b.string
# Capture the marked up source code and notes from the report:
htmlpre = div.div.pre
+
+ errmsg = get_second_col(rows[2])
+ if not errmsg:
+ continue
yield ErrorReport(htmlpath=htmlpath,
htmlid=div['id'],
filename=get_second_col(rows[0]),
function = get_second_col(rows[1]),
- errmsg = get_second_col(rows[2]),
+ errmsg = errmsg,
htmlpre = htmlpre)
class Severity(namedtuple('Severity', ('priority', 'title', 'description'))):
@@ -151,6 +158,14 @@ class Triager:
description='<p>Code paths that will lead to a segmentatation fault</p>')
def classify(self, report):
+ #print('report: %r' % (dir(report), ))
+ #print('report.errmsg: %r' % report.errmsg)
+ if report.errmsg is None:
+ return Severity(priority=PRIORITY__UNCLASSIFIED,
+ title='Unclassified errors',
+ description='''
+<p>The triager didn't know how to classify these ones</p>
+''')
m = re.match('ob_refcnt of (.+) too high', report.errmsg)
if m:
if report.might_be_borrowed_ref():
@@ -241,6 +256,8 @@ class BuildLog:
def __init__(self, path):
self.unimplemented_functions = set()
self.cplusplus_failure = False
+ self.seen_rpmbuild = False
+ self.num_tracebacks = 0
buildlog = os.path.join(path, 'build.log')
with open(buildlog) as f:
@@ -252,11 +269,54 @@ class BuildLog:
if m:
self.unimplemented_functions.add(m.group(1))
- if "AttributeError: 'NoneType' object has no attribute 'vars'" in line:
- self.cplusplus_failure = True
+ # Am seeing errors of this form:
+ # The C++ compiler "/usr/bin/c++" is not able to compile a simple test
+ # program.
+ # It fails with the following output:
+ # Change Dir: /builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp
+ #
+ # Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
+ # /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
+ # CMakeFiles/cmTryCompileExec.dir/build
+ # gmake[1]: Entering directory
+ # `/builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp'
+ # /usr/bin/cmake -E cmake_progress_report
+ # /builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp/CMakeFiles 1
+ # Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o
+ # /usr/bin/c++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
+ # -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o
+ # CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o -c
+ # /builddir/build/BUILD/airrac-0.2.3/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
+ # Traceback (most recent call last):
+ # File "/usr/bin/the-real-g++", line 53, in <module>
+ # p = subprocess.Popen(args)
+ # File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__
+ # errread, errwrite)
+ # File "/usr/lib64/python2.7/subprocess.py", line 1130, in _execute_child
+ # self.pid = os.fork()
+ # OSError: [Errno 11] Resource temporarily unavailable
+ if 'The C++ compiler "/usr/bin/c++" is not able to compile a simple test' in line:
+ self.cplusplus_failure = 'The C++ compiler "/usr/bin/c++" is not able to compile a simple test'
+
+ if not self.cplusplus_failure:
+ if 'OSError: [Errno 11] Resource temporarily unavailable' in line:
+ self.cplusplus_failure = 'OSError: [Errno 11] Resource temporarily unavailable'
+
+ if 'configure: error: C++ compiler cannot create executables' in line:
+ self.cplusplus_failure = 'configure: error: C++ compiler cannot create executables'
+
+ if 'rpmbuild -bb' in line:
+ self.seen_rpmbuild = True
+
+ if line.startswith('Traceback '):
+ self.num_tracebacks += 1
class Index:
def __init__(self, path, title):
+ self.reported = False
+ self.seen_SWIG = False
+ self.seen_Cython = False
+
outpath = os.path.join(path, 'index.html')
with open(outpath, 'w') as f:
f.write('<html><head><title>%s</title></head>\n' % title)
@@ -269,9 +329,18 @@ class Index:
buildlog = BuildLog(path)
if buildlog.cplusplus_failure:
- f.write(' <p>C++ failure</p>\n')
+ f.write(' <p>C++ failure: %s</p>\n' % buildlog.cplusplus_failure)
srpm = Srpm.from_path(path)
- BugReportDb.add_status(srpm, "FIXME: C++")
+ BugReportDb.add_status(srpm, "FIXME: C++ failure: %s" % buildlog.cplusplus_failure)
+ self.reported = True
+ """
+ if not buildlog.seen_rpmbuild:
+ f.write(' <p>Did not see rpmbuild -bb in build.log</p>\n')
+ srpm = Srpm.from_path(path)
+ BugReportDb.add_status(srpm, "FIXME: did not see rpmbuild -bb in build.log")
+ self.reported = True
+ return
+ """
# Gather the ErrorReport by severity
triager = Triager()
@@ -287,6 +356,8 @@ class Index:
#print ' ', os.path.join(dirpath, filename)
htmlpath = os.path.join(dirpath, filename)
for er in get_errors_from_file(htmlpath):
+ if er is None:
+ continue
#print(er.filename)
#print(er.function)
#print(er.errmsg)
@@ -310,6 +381,12 @@ class Index:
href, er.errmsg))
f.write(' </table>\n')
+ if 'SWIG' in er.function or 'SWIG' in er.errmsg:
+ self.seen_SWIG = True
+
+ if '__pyx' in er.function or '__pyx' in er.errmsg:
+ self.seen_Cython = True
+
if buildlog.unimplemented_functions:
f.write(' <h2>Implementation notes for gcc-with-cpychecker</h2>\n')
f.write(' <p>The following "Py" functions were used but aren\'t\n'
@@ -325,6 +402,26 @@ class Index:
f.write(' </body>\n')
f.write('</html>\n')
+ if self.seen_Cython:
+ if not self.reported:
+ srpm = Srpm.from_path(path)
+ BugReportDb.add_status(srpm, "FIXME: Cython-built")
+ self.reported = True
+
+ if self.seen_SWIG:
+ if not self.reported:
+ srpm = Srpm.from_path(path)
+ BugReportDb.add_status(srpm, "FIXME: SWIG-built")
+ self.reported = True
+
+ if buildlog.num_tracebacks >= 5:
+ if not self.reported:
+ srpm = Srpm.from_path(path)
+ BugReportDb.add_status(srpm,
+ ("FIXME: %i tracebacks during build"
+ % buildlog.num_tracebacks))
+ self.reported = True
+
def iter_severities(self):
for sev in sorted(self.severities.keys())[::-1]:
yield sev, self.severities[sev]
diff --git a/misc/fedora/mass-rebuild.py b/misc/fedora/mass-rebuild.py
index b316fd1..af389b6 100644
--- a/misc/fedora/mass-rebuild.py
+++ b/misc/fedora/mass-rebuild.py
@@ -164,7 +164,9 @@ def local_rebuild_of_srpm_in_mock(srpmpath, mockcfg):
# Copy the file from the chroot to our result location:
run_mock(['--copyout', line, dstPath])
-PLUGIN_PATH='gcc-python2-plugin-0.9-1.fc16.x86_64.rpm'
+#PLUGIN_PATH='gcc-python2-plugin-0.9-1.fc16.x86_64.rpm'
+#PLUGIN_PATH='gcc-python2-plugin-0.9-1.with.git.stuff.fc16.a29cf4f671e566a7ee92cb3d604cc6ccfb25b781.x86_64.rpm'
+PLUGIN_PATH='gcc-python2-plugin-0.9-1.with.git.stuff.fc16.1e4eb81.x86_64.rpm'
MOCK_CONFIG='fedora-16-x86_64'
def prepare_bug_report(srpmpath, index):
@@ -238,13 +240,14 @@ gcc-python-plugin post-0.9 git %(gitversion)s running the checker in an *f16* ch
# Rebuild all src.rpm files found in "SRPMS" as necessary:
if 1:
+ #unimplemented_functions = {}
for srpmpath in sorted(glob.glob('SRPMS/*.src.rpm')):
srpmname, version, release = nvr_from_srpm_path(srpmpath)
bugdb = BugReportDb()
# print(bugdb.bugs)
bugdb.print_summary()
- print('Processing %s' % srpmname)
+ print('Processing %s' % srpmpath)
statuses = bugdb.find(srpmname)
if statuses:
for status in statuses:
@@ -253,10 +256,34 @@ if 1:
resultdir = get_result_dir(srpmpath)
if not os.path.exists(resultdir):
+ continue #!
local_rebuild_of_srpm_in_mock(srpmpath, MOCK_CONFIG)
+
+ from makeindex import BuildLog
+ try:
+ buildlog = BuildLog(resultdir)
+ except IOError:
+ continue
+ #for fn in buildlog.unimplemented_functions:
+ # if fn in unimplemented_functions:
+ # unimplemented_functions[fn] += 1
+ # else:
+ # unimplemented_functions[fn] = 1
+
+ #continue
+
index = Index(resultdir, 'Errors seen in %s' % resultdir)
- prepare_bug_report(srpmpath, index)
- break
+ if not index.reported:
+ prepare_bug_report(srpmpath, index)
+ break
+
+if 0:
+ from pprint import pprint
+ pprint(unimplemented_functions)
+ for key, value in sorted([(k, v) for (k, v) in unimplemented_functions.iteritems()],
+ lambda (k1,v1), (k2, v2): cmp(v2, v1)):
+ print key, value
+
# TODO:
# - automate grabbing the src.rpms; see e.g.:
12 years, 1 month