Skip to content
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

Enable 5.2 compatibility in Lua 5.3 #192

Closed
ccarrasc opened this issue Jul 9, 2024 · 2 comments
Closed

Enable 5.2 compatibility in Lua 5.3 #192

ccarrasc opened this issue Jul 9, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ccarrasc
Copy link
Contributor

ccarrasc commented Jul 9, 2024

Is your feature request related to a problem? Please describe.
Lua 5.3 has a compiler flag set to allow 5.2 compatitibilty. I dug through the documentation and was unable to determine if excluding the flag was intentional or not.

Currently, attempting to execute the following results in an exception (attempt to call a nil value (field 'pow')):

         try (var lua = new Lua53()) {
             lua.openLibraries();
             var res = lua.eval("return math.pow(2, 2)");
             return res[0].toNumber();
         }

Describe the solution you'd like
Enable LUA_COMPAT_5_2 for lua53.

Additional context
I think all that is needed is to add -DLUA_COMPAT_5_2 to cFlags in lua53's build.gradle. I can open a PR, but it would take me some time to figure out how to build and test the change.

@ccarrasc
Copy link
Contributor Author

I see the build failed when merged. I can't find the stacktrace to understand the issue. I assume that it's a CI issue since the build passed prior to merge, and there is nothing on top of it. If you need help debugging the build, let me know, @gudzpoz

@gudzpoz
Copy link
Owner

gudzpoz commented Jul 15, 2024

@ccarrasc For the CI errors, I have rather grown accustomed to them:

I consider most of these upstream issues, but have failed to make them reproducible enough to report them. You may look into them, but personally I won't recommend it since debugging CI-only issues is a pain (for me, at least).
Anyways, thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants