Re: [web2py/web2py] cache (and compile) views, models and controllers (#1470)

48 views
Skip to first unread message

Massimo DiPierro

unread,
Sep 30, 2016, 12:34:58 PM9/30/16
to web2py-developers

PR #1194 broke the logic to compile apps. It caused compiled views to always be cached but would not detect when an upstream view was modified.
Example index.html extends layout.html. index.html.pyc would be be cached so any change in layout.html would not cause recompilation.

I reverted it partially. I restored the logic to support views.default.index.html.pyc instead of  views_default_index_html.pyc which means newly compiled web2py apps work but not older ones. we cannot have it both ways.

In the version in master now we have:

    global __builtins__
    if is_jython:  # jython hack                                                                                                                              
        __builtins__ = mybuiltin()
    elif is_pypy:  # apply the same hack to pypy too                                                                                                          
        __builtins__ = mybuiltin()
    elif PY2:
        __builtins__['__import__'] = builtin.__import__  # WHY? 

The PR that was reverted had changed it. I am not sure which one is the correct one because I never tested PyPy nor Jython (and I do not think care about Jython). 

If you know better and have tested the changes can you explain this logic and perhaps make another PR to fix any problem?

Massimo
 

Paolo Valleri

unread,
Sep 30, 2016, 1:52:33 PM9/30/16
to web2py-developers
I don't see a simple way to fix the issue introduced by  PR #1194, however why did you revert also the parts that belong to run_controller_in and run_models_in? Mind that the issue has been there for years in gae.

Regarding the __builtins__ hack, it was there since 2011 and removing it didn't break any unitest or application I tested.

Massimo DiPierro

unread,
Sep 30, 2016, 1:55:27 PM9/30/16
to web2py-d...@googlegroups.com
because I simply reverted the whole file. Could your please make another PR?

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paolo Valleri

unread,
Sep 30, 2016, 2:43:24 PM9/30/16
to web2py-developers
I suggest merging https://github.com/web2py/web2py/pull/1481 and fixing the conflicts caused by the commit reverted. After that we can study a better solution for the issue with run_views_in

Massimo DiPierro

unread,
Sep 30, 2016, 2:56:29 PM9/30/16
to web2py-d...@googlegroups.com
OK. done as suggested. I think I have fixed with a single line change.
Reply all
Reply to author
Forward
0 new messages