OpenWrt Forum Archive

Topic: LUCI LUA compilation stages during system boot

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Dear Openwrt Developers,

WHile debugging the LUCI and trying out my custom changes, I post a question regarding the same and the answers and my own observations conclude this:

During system boot up, the lua files are compiled and then are static, any change done to the lua files has no effect unless the system is reboot, in which case it will be recompiled.

So can someone please point out in which script or startup code is the lua compilation triggered. I grepped for "luac" but couldn't find any reference.

Hi,
there is no Lua pre-compiler.
You battle against LuCI cache and browser cache.

During development set inside /etc/config/luci configuration:

config internal 'ccache'
    option enable '0'

Additional LuCI store dirs and files inside /tmp. You possibly need to remove them.

For me setting ccache to 0 and "reload" the corresponding page inside browser mostly does the job.
In some cases I additional need to clear browsers history and very rarely remove /tmp/luci* files and directories.

Christian

For me "rm -rf /tmp/luci-* ; /etc/init.d/uhttpd restart", does the job.
But, i would like to give a try to the method of disabling ccache as explained by chris5560.

@chris5560 This is working for me. Thanks for the solution.

@th3gr8 With your solution, you need to delete and restart webserver every time you change lua files. @chris's method is much more convenient

The discussion might have continued from here.