Jens-G opened a new pull request, #3883:
URL: https://github.com/apache/thrift/pull/3883
Nothing in CI built or ran `lib/lua`. `build.yml` had no Lua job, and the
docker images only build, so a change to `lib/lua` got no automated coverage.
### `make check` ran nothing
`lib/lua/Makefile.am` had no check target. `make -C lib/lua check` built the
four C modules and stopped there:
```
make: Entering directory '/work/lib/lua'
Making check in .
make[1]: Entering directory '/work/lib/lua'
make[1]: Leaving directory '/work/lib/lua'
make: Leaving directory '/work/lib/lua'
```
None of the three scripts in `lib/lua/test` had ever been executed by a
build. `check-local` now generates the types `test_recursion_depth.lua` loads
from `test/gen-lua/` and runs all three.
### The Lua floor moves from 5.2 to 5.3
Those scripts need 5.3. The stand-ins they preload for the C modules use its
bitwise operators and `string.pack`, so on 5.2 none of the three even parses:
```
lua5.2: test_recursion_depth.lua:40: 'end' expected near '|'
lua5.2: test_http_headers.lua:34: 'end' expected near '|'
lua5.2: test_frame_and_string_limits.lua:33: 'end' expected near '|'
```
configure accepted 5.2, so the new check target would have made `make check`
fail on every 5.2 build. Now:
- configure requires 5.3.
- The focal image installs `lua5.3` instead of `lua5.2`.
- `LANGUAGES.md` gives 5.3 to 5.4 instead of 5.1.5 to 5.4. configure had
already rejected 5.1.
On a 5.2 system configure now reports `Building Lua Library ......... : no`.
**This drops Lua 5.2 for autotools builds.**
### Covering the C modules
Because the scripts preload those stand-ins, they cover the `.lua` sources
only. The job therefore also runs the Lua client against the Lua server through
`test/test.py`, over the three transports and three protocols `test/tests.json`
already lists for Lua. That is what loads `libluasocket`, `libluabpack`,
`liblualongnumber` and `libluabitwise`. With `libluabpack.so` removed, all nine
cases fail.
It has to go through the crossrunner, which starts the client as soon as the
server's port answers. The Lua test server gives up after one second without a
connection, so a fixed sleep before the client would not do.
### The job
- The matrix is the new floor and the version the jammy and noble images
install, 5.3 and 5.4.
- The configure step asserts that Lua was found **and** that it is the leg's
version. configure disables a binding it cannot locate rather than failing.
With a second Lua installed, the `lua` alternative can also point at the other
version.
- `--without-lua` stays in the shared `CONFIG_ARGS_FOR_LIBS`. Every binding
has its flag there, and each job turns its own back on. `sca.yml` keeps it too,
because that list is the bindings with no static analysis. The ticket said both
should go, which was wrong.
The change also drops two stale comments from the ubuntu Dockerfiles:
- the one about `luaL_openlib`, settled by THRIFT-4386;
- "lua5.3 does not install alternatives". On focal and noble alike,
installing `lua5.3` provides `/usr/bin/lua`.
### Verification
Actions are disabled on my fork, so this PR is the job's first run on
GitHub. Locally, I ran the job's own `run:` blocks, extracted from the YAML,
under `bash -e` on clean `ubuntu:24.04` containers:
| Leg | `lib/lua/test` | lua-lua cross test |
|---|---|---|
| Lua 5.3.6 | 30 passed · all ok · 11 checks, 0 failures | 0 failed of 9 |
| Lua 5.4.6 | 30 passed · all ok · 11 checks, 0 failures | 0 failed of 9 |
- I reran the cross test ten more times per leg, on 5.3 with every core
busy. It never failed.
- The job fails at the right step in each negative case:
- without Lua: at configure;
- with a 5.3 interpreter taking the `lua` alternative on the 5.4 leg: at
configure;
- with one script made to fail: at `make check`;
- with a C module missing: at the cross test.
- On Lua 5.2, configure reports the library as not built.
- On `ubuntu:20.04` with `lua5.3`, as the focal image now installs it, `make
check` and the cross test pass.
- `make dist` after `make check` keeps `test/gen-lua` out of the tarball.
- zizmor shows no new findings.
### Not in this PR
- Adding `lua` to the `cross-test` matrix, to test Lua against other
languages.
- `contrib/Vagrantfile` is left untouched. It targets `trusty64` (Ubuntu
14.04, long EOL) and installs `lua5.2`, which configure no longer accepts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]