compile_application() not including symlinked views (while it includes symlinked controllers)

23 views
Skip to first unread message

Lisandro

unread,
Apr 3, 2019, 4:58:43 PM4/3/19
to web2py-users
I have an application that uses symlinks for some of its controllers, models and views.
Symlinked controllers and models are compiled properly, but something weird happens with symlinked views.

For example, this symlinked controller:
controllers/test.py --> symlink to external file

... is properly compiled to this files:
compiled/controllers.test.functionA.pyc
compiled/controllers.test.functionB.pyc


And even the "models" folder, which is totally symlinked:
models/ --> symlink to external folder

... is properly compiled to this file:
compiled/models.db.pyc


So it appears that the compilation follows symlinked files and folders.
But I have a symlinked folder inside "views" and the compilation process appears to ignore it. 

For example, these views:
views/default/index.html
views/global/ --> symlink to external folder

... are compiled to only this:
compiled/views.index.html.pyc


Notice it doesn't include any of the .html files that are inside the symlinked folder.
Is this a bug or is it the expected result?

Leonel Câmara

unread,
Apr 4, 2019, 6:59:49 AM4/4/19
to web2py-users
Could it be a permissions problem?

Lisandro

unread,
Apr 4, 2019, 7:21:09 AM4/4/19
to web2py-users
I don't think so, because the symlink has the same permissions (also owner) of the other symlinks that are compiled properly. Anyway, I tried to set 777 permissions but it didn't work.

I forgot to mention that symlinked views are compiled properly when the symlink points directly to a file, for example:
views/test.html --> symlink to external file

... is properly compiled to this:
compiled/views.test.html.pyc


It appears that the problem is when the symlink points to a folder which contains the html files.

I've taken a look at the source code of compile_views() but I'm not that much experienced so I couldn't say why it doesn't follow symlinked folders :/
Reply all
Reply to author
Forward
0 new messages