minetest-mods / inspector

A minetest node inspector tool that shows various properties of nodes.
GNU Lesser General Public License v2.1
9 stars 8 forks source link

Crash on startup "invalid escape sequence" when using LuaJIT #15

Open OgelGames opened 4 years ago

OgelGames commented 4 years ago
2020-11-09 21:14:21: ERROR[Main]: ModError: Failed to load and run script from ...\worldmods\inspector\init.lua:
2020-11-09 21:14:21: ERROR[Main]: ...\worldmods\inspector\init.lua:56: invalid escape sequence near '"'

I cannot find what changed to cause this, but I was able to get it to work by replacing the escapes (\u{2007} and \u{253c}) on these lines with spaces: https://github.com/minetest-mods/inspector/blob/dea86186d0dffee2285c546ae33d3cef92b5b8c0/init.lua#L56 https://github.com/minetest-mods/inspector/blob/dea86186d0dffee2285c546ae33d3cef92b5b8c0/init.lua#L115

BuckarooBanzay commented 3 years ago

Interesting, this is on startup, right? This may be caused by a platform issue, i had no trouble with the latest -dev version and linux :confused: something, something, windows-encoding-issue perhaps? Also: lua/luajit-version?

OgelGames commented 3 years ago

Interesting, this is on startup, right?

Yes, I can't start without making the above changes.

This may be caused by a platform issue, i had no trouble with the latest -dev version and linux 😕 something, something, windows-encoding-issue perhaps?

Well I do use Windows (10), so possibly.

Also: lua/luajit-version?

Lua 5.1, LuaJIT 2.0.5.

BuckarooBanzay commented 3 years ago

Lua 5.1, LuaJIT 2.0.5.

I found this statement here (https://github.com/luapower/ui0/issues/2)

Unicode escape sequences were added in LuaJIT 2.1. Seems like you're using LuaJIT 2.0. Either convert the code or use the latest LuaJIT.

looks like the problem is "just" the old luajit version

OgelGames commented 3 years ago

looks like the problem is "just" the old luajit version

Hmm... I was sure it was working fine with MT 5.3.0, maybe I somehow only used the official build back then... I'll try updating and rebuilding MT tommorow.

OgelGames commented 3 years ago

I couldn't work out how to change LuaJIT to the latest version, but I did try compiling without LuaJIT and it worked fine, so that seems to be what is causing this error. (I compiled the stable-5 branch of Minetest with LuaJIT and it had the same problem)

I also found the reason that I had LuaJIT 2.0.5 is because that is the stable version (2.1 is beta) that vcpkg installs: https://github.com/microsoft/vcpkg/blob/master/ports/luajit/CONTROL#L2

So if Minetest does require LuaJIT 2.1, then shouldn't be mentioned in the compiling section of the readme? https://github.com/minetest/minetest#a-using-vcpkg-to-install-dependencies