-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Lua to version 5.4 and make constants really read-only #391
Comments
Do you expect any compatibility issues with updating from Lua 5.1.2 to Lua 5.4++? |
Here are all the Language Incompatibilities (from 5.2 to 5.4)
Source: |
I don't think so, but I am no Lua expert. The changes to the C API could cause minor trouble, but I don't find any usages of that. |
Yeah, C-API changes and Library changes must be resolved "in the C++ domain" - if there are any, I don't expect them and I believe a re-compile with the new sources is enough. What I am concerned about is the Lua-Scripts "out there". I expect some (few) to fail, but I can't estimate how many 😉 |
Update: |
Can you post a error message? Maybe its trivial. I remember that coroutines are Luas way of multi-threading, but since than it gets hazy, I last worked with Lua ~15 years ago. |
Sure, let me try it again... (The linker warnings can be ignored for now I think. Either they are because of a wrong threading model /MD etc. or can be resolved otherwise) It's these I'm worried about:
|
Hmm.... there must be a migration guide somewhere. The luaopen_coroutine still existed in 5.3, so it must be related to a 5.4 change. EDIT: Hey... did the lua.lib actually build or not? the build step was reported as failed. |
Orbiter currently uses 5.1 (no idea if it's "official" or somehow patched). |
For whom it might concern 😉 When I manually build Lua like:
...it absolutely works. The procedure can be found all over the internet (for example here: https://blog.spreendigital.de/2019/06/25/how-to-compile-lua-5-3-5-for-windows/ just for a different version) The trick is the rename part, to avoid linking |
Regarding the fear of cross module bugs, I was under the impression that each module had its own interpreter spawned and the only shared state was the Orbiter core itself. |
User Story
As script developer, I want to be sure that no other script can overwrite the variables which refer to OrbiterSDK constants and enums, so that its impossible to cause bugs in a different module.
Detailled description
Since version 5.4, Lua supports the keyword
const
to make variable definitions read-only. By that language feature, we could stop this possible error source. So, the version of Orbiters Lua binding should be raised to 5.4 (at least) and next, the constant definitions in Interpreter.cpp declared to be write protected.Acceptance criteria
const
in Orbiters Lua binding.The text was updated successfully, but these errors were encountered: