From 4086660a2186108f5e0afe87623eb205d1dd2367 Mon Sep 17 00:00:00 2001 From: Nic-dorman Date: Thu, 14 May 2026 13:28:21 +0100 Subject: [PATCH] fix(ant-dev): dispatcher swift no-skip + lua LUA_PATH wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two unrelated dispatcher bugs surfaced when running the full `ant dev example data -l ` sweep across all 15 SDKs on Linux. ## swift The adapter shipped with `skip_reason="REST/gRPC SDK is macOS-only per antd-swift README"`, so swift was silently auto-skipped on every run. The README claim is outdated — the swift toolchain on Linux (swift.org release, 6.0.x) builds and round-trips against antd end-to-end. Replace the skip with a real adapter that runs `swift run AntdExamples N`, mirroring the csharp/kotlin number-arg pattern. ## lua `luarocks --local --lua-version=5.4 make` installs the rock under `~/.luarocks/share/lua/5.4/antd/`, which `lua5.4` doesn't pick up by default. The adapter just called `lua5.4 examples/02-data.lua`, so the example fataled with `module 'antd' not found`. Wrap the run via `bash -c 'eval "$(luarocks --local --lua-version=5.4 path)" && exec lua5.4 "examples/$1"'` so the freshly-installed rock is on LUA_PATH/LUA_CPATH for the subprocess. Filename comes from the `examples` dict (static), passed as a positional arg to the inner shell — no string interpolation into the command line. ## Test plan Verified end-to-end on a Linux dev box (Ubuntu 24.04, Swift 6.0.3, Lua 5.4): - [x] `ant dev example data -l swift` — round-trip OK, real `Estimate: 24 bytes in 3 chunks, ...` (no skip) - [x] `ant dev example data -l lua` — round-trip OK ("Public data round-trip OK!") - [x] Other 13 SDKs unchanged (cpp/csharp/dart/elixir/go/java/js/ kotlin/php/python/ruby/rust/zig) — full sweep 15/15 green Co-Authored-By: Claude Opus 4.7 (1M context) --- ant-dev/src/ant_dev/cmd_example.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ant-dev/src/ant_dev/cmd_example.py b/ant-dev/src/ant_dev/cmd_example.py index 008fcb61..020f6aaf 100644 --- a/ant-dev/src/ant_dev/cmd_example.py +++ b/ant-dev/src/ant_dev/cmd_example.py @@ -123,7 +123,14 @@ def _venv_python() -> str: "graph": "05-graph.lua", "private": "06-private-data.lua", }, prep=[lambda cwd: ["luarocks", "--local", "--lua-version=5.4", "make"]], - run=lambda cwd, f: ["lua5.4", f"examples/{f}"], + # `luarocks --local make` installs into ~/.luarocks, which lua5.4 + # doesn't pick up by default. Source `luarocks path` so LUA_PATH / + # LUA_CPATH point at the freshly-installed rocks. + run=lambda cwd, f: [ + "bash", "-c", + 'eval "$(luarocks --local --lua-version=5.4 path)" && exec lua5.4 "examples/$1"', + "--", f, + ], ), "cpp": Adapter( sdk_dir="antd-cpp", @@ -191,9 +198,12 @@ def _venv_python() -> str: ), "swift": Adapter( sdk_dir="antd-swift", - examples={}, - run=lambda cwd, n: [], - skip_reason="REST/gRPC SDK is macOS-only per antd-swift README", + examples={ + "connect": "1", "data": "2", "chunks": "3", + "files": "4", "private": "6", "all": "all", + }, + prep=[lambda cwd: ["swift", "build"]], + run=lambda cwd, n: ["swift", "run", "AntdExamples", n], ), }