richardhundt / shine

A Shiny Lua Dialect
Other
231 stars 18 forks source link

"tonumber" used but not defined #81

Closed dvv closed 6 years ago

dvv commented 6 years ago

I'm building shine on a mips router. The process chokes at:

make[1]: Entering directory '/tmp/shine/shine/lib'
../boot/bin/shinec  -n "async"          async/init.shn  /tmp/shine/shine/build/async.o
../boot/bin/shinec  -n "async.fiber"    async/fiber.shn /tmp/shine/shine/build/async_fiber.o
../boot/bin/shinec  -n "async.loop"     async/loop.shn  /tmp/shine/shine/build/async_loop.o
tvmjit: /tmp/shine/shine/boot/src/shine/lang/translator.raw:0: shine: async/loop.shn:116: "tonumber" used but not defined

Please, give a clue where should I define tonumber?

richardhundt commented 6 years ago

I can't reproduce this [on linux]. However, it looks like an issue with global symbol tracking.

You can see here these symbols are added dynamically by looping over _G and declaring them. You could try to add it to the globals table manually, but my guess is there's something else going on. Why isn't tonumber available in _G?

EDIT: those .raw files are Lua bytecode which tvmjit should be able to run without external dependencies on previously installed Lua interpreter, but something on mips seems to be different. You could try bumping the tvmjit version in the submodule, see if that helps.

dvv commented 6 years ago

The issue might come because of luajit for mips. I had to give up since their libc doesn't expose dlopen which is required to loas modules. Sorry for buzz