Luarocks + Corona SDK

That is correct, however I am talking about source-only rocks. Actually I am simply seeking confirmation whether setting my described behavior is a bug or intended behavior. See again:

Now I am changing lua’s search path so that I can easily include the module:

package.path = ‘lua_modules/share/lua/5.1/?.lua’ … package.path

 

However, after requiring the module:

local log = require(‘coronalog’)

 

Corona Simulator gives me the following error:

ERROR: Runtime error

module ‘coronalog’ not found:

   no field package.preload[‘coronalog’]

   no file ‘lua_modules/share/lua/5.1/coronalog.lua’

   …

 

In the stack trace you can see that the search path was modified correctly and Corona’s lua interpreter is actually trying to load from the correct path, but is still unable to load.

 

Again, lua_modules/share/lua/5.1/coronalog.lua is the correct path relative to my Corona project folder. lua_modules is a sub-folder in there, it is no system directory!

 

So, is this a bug or a feature request?

It’s an intended and sometimes required behavior because of vendor rules (Apple, Google, etc.).

If you’re interested in the specifics I can go into more detail. But to make it short, C is the driver, not Lua. You’re confusing the use case. You won’t be able to change the package path, because that’s not where the control is taking place.

You can submit a feature request here: http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback

Cheers.

@ tyrondis

If you do a print(package.path), does it actually give you what you expect to see? (Before and after extending it.) Or are most of the interesting paths absolute, rather than relative? (Not sure what platform you’re looking at.) Also, in your actual code, are you separating them? From your output message it would seem so, but your example doesn’t have the semi-colon.

If it’s a matter of absolutizing the path, maybe tap32’s post here would help.