Skip to content

ci(lua): build and smoke-test edgetx-luac on Linux, macOS and Windows - #7848

Merged
pfeerick merged 3 commits into
EdgeTX:mainfrom
pfeerick:luac-ci
Sep 30, 2026
Merged

pfeerick merged 3 commits into
EdgeTX:mainfrom
pfeerick:luac-ci

Conversation

@pfeerick

Copy link
Copy Markdown
Member

Nothing in CI builds the standalone Lua compiler added in #7275, so changes under radio/src/thirdparty/Lua could break it without anyone noticing. As it turns out, it didn't build with MSVC at all.

Changes

  • New .github/workflows/luac.yml. It runs only when radio/src/thirdparty/Lua/** or the workflow itself changes. On Linux, macOS and Windows it:
    • builds edgetx-luac with CMake
    • compiles a small script and checks the bytecode header matches the radio's 32-bit layout (1B4C7561 53 00 19930D0A1A0A 04 04 04 04 04)
    • loads the result back through lundump
    • checks that a script with a syntax error is rejected
  • luac.c: declare alloca() for MSVC. Until now <alloca.h> was only included for GCC/clang.
  • lobject.h: drop the trailing ; from the CommonTable macro. It's used as CommonTable;, which leaves an empty member declaration in struct Table and struct ROTable. GCC and clang accept that (-Wpedantic warns), but MSVC rejects it, and every file that includes lobject.h then fails. This changes neither code generation nor the bytecode edgetx-luac produces (checked byte for byte).

Testing

🤖 Generated with Claude Code

pfeerick and others added 3 commits September 30, 2026 09:45
Nothing in CI built the standalone compiler added in EdgeTX#7275, so a change
under radio/src/thirdparty/Lua could break it unnoticed. Build it on all
three runner OSes, check the bytecode header matches the radio's 32-bit
layout, load the result back, and check a syntax error is rejected.

luac.c only pulled in alloca() for GCC/clang; include <malloc.h> for
MSVC so the Windows build works with the default generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UCRT's malloc.h only maps alloca to _alloca when non-standard names are
enabled, which /std:c11 and later turn off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The macro ended in ';' and was used as 'CommonTable;', leaving an empty
member declaration in struct Table and struct ROTable. GCC and clang
accept that (-Wpedantic warns), but MSVC rejects it, which broke every
file that includes lobject.h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick pfeerick added this to the 3.0 milestone Sep 30, 2026
@pfeerick pfeerick added the ci/cd 🔧 Related to GitHub Actions and similar issues label Sep 30, 2026
@pfeerick
pfeerick merged commit 1468055 into EdgeTX:main Sep 30, 2026
42 checks passed
pfeerick added a commit to EdgeTX/edgetx-luac-action that referenced this pull request Sep 30, 2026
EdgeTX/edgetx#7848 fixed the MSVC build, so pin the compiler to its
merge commit and drop the tests' temporary override that built from
pfeerick/edgetx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick
pfeerick deleted the luac-ci branch September 30, 2026 10:41
pfeerick added a commit to EdgeTX/edgetx-luac-action that referenced this pull request Oct 1, 2026
- AGENTS.md: guide for AI tools covering architecture, the rules learned
  the hard way (stdlib-only scripts, LF step outputs on Windows, bash 3.2
  on macOS, POSIX paths), the uv.lock-based pre-commit setup, action
  version policy, updating the pinned compiler, and commit/PR conventions.
- CLAUDE.md imports it (`@AGENTS.md`), with no symlinks.
- CONTRIBUTING.md: setup (uv sync, pre-commit install), how the scripts
  fit together, checks, local testing, commits and PRs, updating the
  compiler (from EdgeTX/edgetx#7848 onwards) and releasing.
- README.md: maintainer material moves to CONTRIBUTING.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd 🔧 Related to GitHub Actions and similar issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant