-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
Use lua-compat-5.3 project instead of carrying own compatibility code #508
Comments
I started with lua-compat-5.2 (a few years ago), but it's out-of-the-box build was not suitable for a single header library. It's license is still listed in the documentation and I still credit it, but. It had a myriad of errors that I had to manually fix for a few different platforms. I would like to update to later versions but each time I'd need to pull the code, scrub the I'm not quite ready to make that effort just yet, but I'll keep it on my TODO list. |
lua-compat-5.3 supports a single header mode: infact that's the default. See https://github.com/keplerproject/lua-compat-5.3#c-code
Much of that has been fixed in lua-compat-5.3. e.g. use |
My primary problem wasn't export issues: that was just at the start. I'm going to list what I remember running into here and then checking them off 1 by 1 as I find the functions here or figure out proper work arounds to augment the header.
So far it's not a very long list because most of my qualms are buried in the commit history somewhere: I'm sure if I ran my tests with LuaJIT 2.0.x and LuaJIT 2.1.x-{whatever} I'd remember the rest, but I'm going to need a little time. |
File a bug against lua-compat-5.3?
But
I'd love it if you could not have any patches, but use exact-as-upstream code.
It does :) |
In the meantime, if you're using sol2, you can define This will allow you to sidestep the current compatibility headers and use anything you yourself include. We do not define anything related to Lua's configuration before including sol2, so you can turn off the compat header and include things yourself if you're so inclined. Finally, for my API's versions of It seems like they're aware of |
You can check if the first byte is |
If that's the case then I could probably write the function myself and submit it as a patch, then. Thanks for letting me know! |
Note: by It's what lua does internally via |
Some initial impressions.
The compilation doesn't get further than that, so I can't start testing for |
As promised, I made a pull request fixing all errors: lunarmodules/lua-compat-5.3#31 If this is accepted, I will transition. Otherwise, I will stay as-is. |
Some more errors I found while building on other platforms.
|
See https://github.com/keplerproject/lua-compat-5.3/wiki/yieldable_c_functions |
Final tests should be passing soon enough using the latest of the project plus the fixes I put in the repo: as long as it continues to work as advertised everything should be fine: https://travis-ci.org/ThePhD/sol2/builds/273887242 |
Even if the PR doesn't get accepted, we have the files internally in sol2. I'll track things and keep it as up to date as I can, though I can't make any promises since we don't submodule the code directly and I would be required to manually check the compat headers and pull them in every now and then. |
FWIW I usually use git subtree add --prefix=vendor/compat-5.3 --squash https://github.com/keplerproject/lua-compat-5.3 v0.5 Then when a new release comes out that I want to upgrade to: git subtree pull --prefix=vendor/compat-5.3 --squash https://github.com/keplerproject/lua-compat-5.3 v0.6 |
Is there any way I can pull in just the |
Sort of, by first doing a PS, If you use the top level subdirectory |
https://github.com/keplerproject/lua-compat-5.3
The text was updated successfully, but these errors were encountered: