Hello everyone,<br><br>I'm trying to get my head around PyPy (hoping maybe to participate in the PyPy sprint at EuroPython), and following the getting-started guide on the Web site. Translating pypy with the C backend worked with no problems on my machine, but neither the JVM nor CLI backends work. (I tried both the pypy-dist version and the SVN trunk.)<br>
<br>The stacktrace for the error is:<br> Traceback (most recent call last):<br> File "translate.py", line 273, in main<br> drv.proceed(goals)<br> File "C:\Src\pypy\pypy\translator\driver.py", line 704, in proceed<br>
return self._execute(goals, task_skip = self._maybe_skip())<br> File "C:\Src\pypy\pypy\translator\tool\taskengine.py", line 116, in _execute<br> res = self._do(goal, taskcallable, *args, **kwds)<br> File "C:\Src\pypy\pypy\translator\driver.py", line 267, in _do<br>
res = func()<br> File "C:\Src\pypy\pypy\translator\driver.py", line 395, in task_backendopt_ootype<br> backend_optimizations(self.translator)<br> File "C:\Src\pypy\pypy\translator\backendopt\all.py", line 80, in backend_optimizations<br>
inline_heuristic=heuristic)<br> File "C:\Src\pypy\pypy\translator\backendopt\all.py", line 156, in inline_malloc_removal_phase<br> call_count_pred=call_count_pred)<br> File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 779, in auto_inline_graphs<br>
call_count_pred=call_count_pred)<br> File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 750, in auto_inlining<br> call_count_pred, cleanup=False)<br> File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 108, in inline_function<br>
return inliner.inline_all()<br> File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 217, in inline_all<br> self.inline_once(block, index_operation)<br> File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 244, in inline_once<br>
self.translator, self.raise_analyzer):<br> File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 160, in any_call_to_raising_graphs<br> if does_raise_directly(graph_or_something, raise_analyzer):<br>
File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 153, in does_raise_directly<br> if raise_analyzer.can_raise(op):<br> File "C:\Src\pypy\pypy\translator\backendopt\canraise.py", line 33, in can_raise<br>
return self.analyze(op, seen)<br> File "C:\Src\pypy\pypy\translator\backendopt\graphanalyze.py", line 38, in analyze<br> return self.analyze_external_call(op)<br> File "C:\Src\pypy\pypy\translator\backendopt\canraise.py", line 21, in analyze_external_call<br>
fnobj = deref(op.args[0].value)<br> File "C:\Src\pypy\pypy\rpython\typesystem.py", line 153, in deref<br> assert isinstance(ootype.typeOf(obj), ootype.OOType)<br> AssertionError<br><br>When I evaluate 'obj' with the pdb, I get:<br>
(Pdb+) p obj<br><* fn CryptGenRandom><br><br>As far as I understand, the problem happens because the 'posix' module under Win32 implements 'urandom' by calling the native CryptGetRandom function through rffi, but there is no mapping for this call under the JVM and CLI backends.<br>
<br>What would be the proper way to fix this problem? (Or maybe I'm doing something that's not supposed to work at all at this stage of the project?)<br><br>(Looks like my question should be at least partly answered by the "OO backends" section of the document at <a href="http://codespeak.net/pypy/dist/pypy/doc/rffi.html">http://codespeak.net/pypy/dist/pypy/doc/rffi.html</a> but unfortunately all it says is "XXX to be written".)<br>
<br>Thanks in advance for your help!<br><br>Dmitry<br>