Fix lua5.5 on Linux and macOS#10
Open
cclauss wants to merge 1 commit into
Open
Conversation
31c3d84 to
3238310
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to make the project work reliably with Lua 5.5 on Linux and macOS by adjusting build/link behavior, adding CI coverage, and improving test execution via pytest/doctest.
Changes:
- Adds a GitHub Actions CI workflow to build and run Lua/Python bridge tests on Linux and macOS for Lua 5.5.
- Updates the LuaRocks Makefile/rockspec variables and
setup.pyenvironment setup to improve library discovery/linking. - Refactors/extends tests by converting doctest expectations and adding a pytest-based test suite.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_lua.py |
Refactors doctests to be less brittle and gates some python-module interactions behind TODOs. |
tests/test_lua_via_pytest.py |
Adds pytest equivalents of the doctest coverage (with several tests currently skipped). |
setup.py |
Modernizes Py3 detection and sets a default PKG_CONFIG_PATH when missing. |
Makefile.luarocks |
Adjusts macOS linker settings and introduces Lua library linking logic (currently macOS-only). |
lunatic-python-scm-0.rockspec |
Passes LUA_LIBDIR into the Makefile build variables. |
.github/workflows/ci.yml |
Adds CI matrix for Lua 5.5 on Linux/macOS and runs doctest, Lua tests, and pytest. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+32
to
+36
| ifeq ($(shell uname -s),Darwin) | ||
| LDFLAGS := $(shell python3-config --embed --ldflags) $(if $(and $(LUA_LIBDIR_FILE),$(or $(LUA_LIBDIR),$(LUA_INCDIR))),$(or $(LUA_LIBDIR),$(patsubst %/include,%/lib,$(LUA_INCDIR)))/$(LUA_LIBDIR_FILE),$(if $(or $(LUA_LIBDIR),$(LUA_INCDIR)),-L$(or $(LUA_LIBDIR),$(patsubst %/include,%/lib,$(LUA_INCDIR))) -llua,)) | ||
| else | ||
| LDFLAGS := $(shell python3-config --embed --ldflags) | ||
| endif |
Comment on lines
+8
to
+11
| # TODO: Remove this skip marker and fix the segmentation fault issues. | ||
| skip_segfault = pytest.mark.skip( | ||
| reason="Segmentation fault in LuaJIT when accessing table elements" | ||
| ) |
Comment on lines
+42
to
+44
| - run: python -m doctest tests/test_lua.py || true # doctest fails on macOS 13.6, but works on macOS 14.0 | ||
| - run: lua${{ matrix.lua-version }} tests/test_py.lua | ||
| - run: python -m doctest tests/test_lua.py |
d8ce3a5 to
545de80
Compare
545de80 to
32416fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: bastibe#100
lua5.5 tests/test_py.lua# fails...lua tests/test_py.luaon Lua 5.1, 5.2, 5.3, 5.4, and 5.5 on Ubuntu 26.04.The tests pass on lua5.1 and lua5.3 but fail on lua5.5 with:
https://github.com/bastibe/lunatic-python/blob/26d0ac7563eeedc22fb04f103e3d16cebe382f5d/src/luainpython.c#L586