Skip to content

Fix CI failure: detect Lua from LUA env var when pkg-config is unavailable#12

Open
cclauss wants to merge 1 commit into
masterfrom
gh-actions-lua
Open

Fix CI failure: detect Lua from LUA env var when pkg-config is unavailable#12
cclauss wants to merge 1 commit into
masterfrom
gh-actions-lua

Conversation

@cclauss

@cclauss cclauss commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Fixes the failing GitHub Actions job ci (ubuntu-26.04, 5.1, leafo).

Root Cause

The leafo/gh-actions-lua action installs Lua into a local .lua/ directory without generating a pkg-config .pc file. setup.py relied solely on pkg-config --exists lua5.x to locate Lua, which silently failed for all versions, raising:

Exception: No compatible version of Lua found. Tried ['5.5', '5.4', '5.3', '5.2', '5.1']

Fix

Modified setup.py to fall back to the LUA environment variable (set by leafo/gh-actions-lua to the path of the Lua binary) when pkg-config finds no compatible Lua version:

  • Runs lua -v on the binary to parse the version number via regex.
  • Derives LUA_INCDIR and LUA_LIBDIR from the binary's parent directory (e.g. .lua/include/ and .lua/lib/).
  • Builds the C extension using these manually specified paths and the lua library name (as produced by a source build), bypassing pkg-config for Lua only.

The existing pkg-config-based path is unchanged, so system-installed Lua installations continue to work as before.

Copilot AI changed the title Use gh-actions-lua instead of apt-get, brew, and choco Fix CI failure: detect Lua from LUA env var when pkg-config is unavailable Jun 28, 2026
@cclauss cclauss force-pushed the gh-actions-lua branch 26 times, most recently from 2586e77 to 89b2c57 Compare June 28, 2026 13:46
@cclauss cclauss force-pushed the gh-actions-lua branch 14 times, most recently from 71f3821 to 9c62421 Compare June 28, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant