On 17 December 2011 19:48, Romain Guillebert wrote:
> Hi everyone
>
> I rebased the ctypes backend branch to the last cython commit, and I
> wondered how the branch should be merged with the main cython
> repository. I see 3 options : a) upload the branch without merging it b)
> merge the branch but not run the test suite on ctypes by default or c)
> merge the branch and run the test suite.
>
> I think it's better to do c) but the test results shouldn't mix with the
> results of the other backends.
>
> What do you think ?
>
> Romain
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
I think before we try merging anything, we should assess what
functionality is there and how well it works. Could you explain what
the ctypes backend currently supports, and which tests it
passes/doesn't pass?
I checked out our your branch from github
(https://github.com/hardshooter/CythonCTypesBackend) but when I run
cython on a script that uses any Cython utility code the compiler
crashes (see below for details).
# test.pyx
cdef int[:] slice
# output:
Error compiling Cython file:
...
cdef extern from *:
cdef object __pyx_test_dep(object)
^
TestClass:5:31: Compiler crash in ControlFlowAnalysis
ModuleNode.body = StatListNode(TestClass:4:0)
CDefExternNode.body = StatListNode(TestClass:5:9)
CVarDefNode.declarators[0] = CFuncDeclaratorNode(TestClass:5:30,
calling_convention = '')
CFuncDeclaratorNode.args[0] = CArgDeclNode(TestClass:5:31,
is_generic = 1)
Compiler crash traceback from this point on:
File "/Users/mark/cy/Cython/Compiler/Visitor.py", line 176, in _visitchild
result = handler_method(child)
File "/Users/mark/cy/Cython/Compiler/FlowControl.py", line 735, in
visit_CArgDeclNode
entry = self.env.lookup(node.name)
AttributeError: 'CArgDeclNode' object has no attribute 'name'
Traceback (most recent call last):
File "/Users/mark/code/cython/bin/cython", line 8, in
main(command_line = 1)
File "/Users/mark/cy/Cython/Compiler/Main.py", line 670, in main
result = compile(sources, options)
File "/Users/mark/cy/Cython/Compiler/Main.py", line 645, in compile
return compile_multiple(source, options)
File "/Users/mark/cy/Cython/Compiler/Main.py", line 617, in compile_multiple
result = run_pipeline(source, options)
File "/Users/mark/cy/Cython/Compiler/Main.py", line 476, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
File "/Users/mark/cy/Cython/Compiler/Pipeline.py", line 375, in run_pipeline
data = phase(data)
File "/Users/mark/cy/Cython/Compiler/ParseTreeTransforms.py", line
1401, in __call__
return super(AnalyseDeclarationsTransform, self).__call__(root)
File "/Users/mark/cy/Cython/Compiler/Visitor.py", line 276, in __call__
return super(CythonTransform, self).__call__(node)
File "/Users/mark/cy/Cython/Compiler/Visitor.py", line 259, in __call__
return self._visit(root)
File "/Users/mark/cy/Cython/Compiler/Visitor.py", line 165, in _visit
return handler_method(obj)
File "/Users/mark/cy/Cython/Compiler/ParseTreeTransforms.py", line
1409, in visit_ModuleNode
node.analyse_declarations(self.env_stack[-1])
File "/Users/mark/cy/Cython/Compiler/ModuleNode.py", line 96, in
analyse_declarations
self.body.analyse_declarations(env)
File "/Users/mark/cy/Cython/Compiler/Nodes.py", line 337, in
analyse_declarations
stat.analyse_declarations(env)
File "/Users/mark/cy/Cython/Compiler/Nodes.py", line 1047, in
analyse_declarations
base_type = self.base_type.analyse(env)
File "/Users/mark/cy/Cython/Compiler/Nodes.py", line 858, in analyse
axes_specs = MemoryView.get_axes_specs(env, self.axes)
File "/Users/mark/cy/Cython/Compiler/MemoryView.py", line 696, in
get_axes_specs
cythonscope.load_cythonscope()
File "/Users/mark/cy/Cython/Compiler/CythonScope.py", line 104, in
load_cythonscope
self, cython_scope=self)
File "/Users/mark/cy/Cython/Compiler/UtilityCode.py", line 147, in
declare_in_scope
tree = self.get_tree(entries_only=True, cython_scope=cython_scope)
File "/Users/mark/cy/Cython/Compiler/UtilityCode.py", line 127, in get_tree
assert not err, err
AssertionError:
Error compiling Cython file:
...
cdef extern from *:
cdef object __pyx_test_dep(object)
^
TestClass:5:31: Compiler crash in ControlFlowAnalysis
ModuleNode.body = StatListNode(TestClass:4:0)
CDefExternNode.body = StatListNode(TestClass:5:9)
CVarDefNode.declarators[0] = CFuncDeclaratorNode(TestClass:5:30,
calling_convention = '')
CFuncDeclaratorNode.args[0] = CArgDeclNode(TestClass:5:31,
is_