Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: PyPy

by
ruben.de.smet
- 05/30/2015 06:51:18
On 30/05/15 01:59, Nicolas PIGANEAU wrote:
> Hi,
> Has anyone tried to run Odoo on PyPy recently ?
> On my side, I used:
> - lxml-cffi from git://github.com/amauryfa/lxml.git
> - latest gevent sources (after merging https://github.com/gevent/gevent/pull/552 )
> - psycopg2cffi and psycopg2cffi-compat (pip install)
> I had also to patch Odoo sources to add pypy opcodes to safe_eval:
> --- ../GitHub/odoo/openerp/tools/safe_eval.py	(date 1432802291000)
> +++ ../GitHub/odoo/openerp/tools/safe_eval.py	(date 1432901508000)
> @@ -69,6 +69,7 @@
> _SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [
> 'LOAD_NAME', 'CALL_FUNCTION', 'COMPARE_OP', 'LOAD_ATTR',
> +  'CALL_METHOD','LOOKUP_METHOD',
> 'STORE_NAME', 'GET_ITER', 'FOR_ITER', 'LIST_APPEND', 'DELETE_NAME',
> 'JUMP_FORWARD', 'JUMP_IF_TRUE', 'JUMP_IF_FALSE', 'JUMP_ABSOLUTE',
> 'MAKE_FUNCTION', 'SLICE+0', 'SLICE+1', 'SLICE+2', 'SLICE+3', 'BREAK_LOOP',
> 
> 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/server.py	(date 1432802291000)
> +++ ../GitHub/odoo/openerp/service/server.py	(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):
> pass
> 
> 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 !
> Nicolas PIGANEAU
> -------------------
> NDP Systèmes
> 06 68 93 87 56
> http://www.ndp-systemes.fr
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-framework-62
> Post to: mailto:expert-framework@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
> 


Hi Nicolas,

Skimming through your message looks like you had exactly the same issues
as I had. If you search a little on this list (perhaps just Google on my
name, together with Odoo, (hint, it's this thread:
https://www.odoo.com/nl_NL/groups/community-framework-62/community-framework-10089512
)), you can read through the things I tried some months ago.

If you succeed in running Odoo on PyPy, please post to this list. In the
meanwhile, I'm building my own software in C++14 for the simple features
that I'd use of Odoo.

Otherwise, if you're interested in making Odoo run on PyPy, I know there
are people on this list interested in working together. (eg. George
Mengelberg)

Good luck and greetings,

Ruben De Smet