martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.21k stars 258 forks source link

compatible with Lua 5.3/5.4 #903

Closed starwing closed 1 year ago

starwing commented 3 years ago

Lua 5.3/5.4 has some differences with Lua5.2:

with this patch vis build succeed on Lua 5.4.1

martanne commented 3 years ago

Could you please provide a bit more context? What is the exact error you got? Did you (re-)run ./configure?

603ee4688ca0da05840bbc15241ee53b02d0987d defines LUA_COMPAT_5_3 which should fix this the other way around i.e. by providing the deprecated legacy functions in term of newer ones.

I'm not necessarily saying that we shouldn't migrate to the newer interfaces. However, the current code (if compiled correctly) should already work with Lua 5.4.

starwing commented 3 years ago

Sorry for the confusion :-)

I'm new to vis. When I first try to build vis, I noticed the compiling error repotting in #843, so I apply this change to support new interface. But after some tweak I rebuild the vis, I find that the build error is because the config.mk is not applying. After re-run configure (in another machine which without this patch) the build success.

So feel free with this patch, maybe I could help to make vis-lua.c compatible with all versions of Lua without add the COMPAT flags in config.mk

mcepl commented 3 years ago

What is the status of this PR? Shouldn’t it be closed? vis builds for me just fine with Lua 5.4 on openSUSE/Tumbleweed.

starwing commented 3 years ago

What is the status of this PR? Shouldn’t it be closed? vis builds for me just fine with Lua 5.4 on openSUSE/Tumbleweed.

I still think we should use the new interface instead, because Lua_Unsigned will not belong to Lua any more. But it's up to the author to decide we use the newer interface or just using compatible flags to keep old interface.

So if @martanne think it's unnecessary, just feel free to close this pr :)

mcepl commented 3 years ago

Of course, and I wouldn’t mind to declare vis just follow the latest Lua (although, neovim with its reliance on LuaJIT has a point as well).

rnpnr commented 1 year ago

I'm going to close this for now since it doesn't simplify any code or fix any current issues. Lua 5.1 is still supported pretty much everywhere and even if that stops there is still LuaJIT.

This can be revisited in the future if it ever actually matters (i.e. vis' Lua support ends up broken or updating offers some big benefit to vis).