Technical mailing list archives



- 05/29/2015 12:09:06

Has anyone tried to run Odoo on PyPy recently ? 

On my side, I used: 
- lxml-cffi from git:// 
- latest gevent sources (after merging ) 
- psycopg2cffi and psycopg2cffi-compat (pip install)

I had also to patch Odoo sources to add pypy opcodes to safe_eval: 

--- ../GitHub/odoo/openerp/tools/	(date 1432802291000)
+++ ../GitHub/odoo/openerp/tools/	(date 1432901508000)
@@ -69,6 +69,7 @@
 _SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [

And also add this one if I wanted to start in multi-worker mode (for some reason pypy complained they were float instead of int): 

--- ../GitHub/odoo/openerp/service/	(date 1432802291000)
+++ ../GitHub/odoo/openerp/service/	(date 1432901508000)
@@ -713,7 +713,7 @@
             raise Exception('CPU time limit exceeded.')
         signal.signal(signal.SIGXCPU, time_expired)
         soft, hard = resource.getrlimit(resource.RLIMIT_CPU)
-        resource.setrlimit(resource.RLIMIT_CPU, (cpu_time + config['limit_time_cpu'], hard))
+        resource.setrlimit(resource.RLIMIT_CPU, (int(cpu_time + config['limit_time_cpu']), hard))
     def process_work(self):

Then my server starts all right and I am able to go to the database manager page.
Creating a database seems to work, but it is then impossible to load the created database. Indeed, it seems some imports have been skipped.
In particular, ir_model_data is only filled with xml_ids of the base module.

So I created a database from a cpython instance and accessed it through my pypy instance. I could login, but then the loading stopped after 
displaying the top menu. A look in firebug showed that JS complained about "nv" not being defined in graph_widget.js. 

So I checked what had been loaded, and found out that only one every other scripts had been loaded from this module, but also from all 
other modules. Same goes for css files: one loaded, one skipped, one loaded, etc. for each line of the assets_backend extension template 
(web_graph/views/web_graph.xml in this case).

I suppose this an issue linked with lxml, that sort of misses one line every two lines but I haven't got a clue on where to go now. 

Any idea or experience on this?

Thanks !


NDP Systèmes
06 68 93 87 56