Skip to content

fix(antd-lua): add missing discover module to rockspec; fix example cost-table concat#76

Merged
Nic-dorman merged 1 commit into
mainfrom
fix/lua-rockspec-discover
May 14, 2026
Merged

fix(antd-lua): add missing discover module to rockspec; fix example cost-table concat#76
Nic-dorman merged 1 commit into
mainfrom
fix/lua-rockspec-discover

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

Fixes #68.

Two-part fix:

1. Rockspec gap (the headline bug). antd-scm-1.rockspec declared only 5 of the 6 .lua modules under src/antd/antd.discover was missing. After luarocks make, require("antd") blew up immediately because client.lua:10 does require("antd.discover") and there was no installed file for it:

```
module antd.discover not found:
no file '/usr/local/share/lua/5.4/antd/discover.lua'
no file '/home/nic/.luarocks/share/lua/5.4/antd/discover.lua'
...
```

One-line rockspec addition.

2. Example cost-table stringification. Once require worked the example then crashed on:

```
examples/02-data.lua:34: attempt to concatenate a table value (local 'cost')
```

Client:data_cost() returns a Lua table {cost, file_size, chunk_count, estimated_gas_cost_wei, payment_mode}, but the example concatenated the whole table to a string. Same shape as #66 (PHP) and #67 (Elixir). 02-data.lua is reworked end-to-end to match the Python/PHP/Elixir layout (estimate first, then store, then assert round-trip + OK marker). 04-files.lua:43 and 05-graph.lua:50 get single-line fixes.

Test plan

  • luarocks --local --lua-version=5.4 make installs all 6 modules in ~/.luarocks/share/lua/5.4/antd/
  • lua5.4 examples/02-data.lua against a local devnet — exits 0, prints estimate + address, "Public data round-trip OK!"
  • Verified via the cross-SDK e2e harness
  • 04-files.lua and 05-graph.lua are visually verified only — both have unrelated upstream issues (e.g. 04-files references a result.storage_cost_atto field whose presence I didn't verify here)

Linux/Lua-5.4 footnote

For Linux contributors: Ubuntu's luarocks package defaults to Lua 5.1. To install for 5.4 specifically: luarocks --local --lua-version=5.4 make (plus apt install liblua5.4-dev). Worth a one-line mention in antd-lua/README.md but out of scope here.

…ost-table concatenation

The rockspec listed only 5 of the 6 .lua modules — antd.discover was
missing — so after luarocks make, require("antd") failed:

  module antd.discover not found:
    no file .../antd/discover.lua

Add the missing entry.

Also fix three examples that tried to concatenate a Lua table (the cost
estimate) directly to a string — same shape as #66 (PHP) and #67 (Elixir).
02-data.lua is reworked to match the Python/PHP/Elixir shape (estimate-
then-store, round-trip assertion, OK marker); 04-files.lua and 05-graph.lua
get single-line fixes.

Closes #68
@Nic-dorman Nic-dorman merged commit fc3af1e into main May 14, 2026
@Nic-dorman Nic-dorman deleted the fix/lua-rockspec-discover branch May 14, 2026 11:03
Nic-dorman added a commit that referenced this pull request May 14, 2026
Cuts v0.7.1 atop v0.7.0. Primarily refreshes the upstream `ant-core`
pin to the `ant-cli-v0.2.3` release tag (no API change for antd
consumers). Bundles a substantial round of cross-SDK example/build
fixes, dispatcher improvements, and CI/release workflow hardening.

## antd

- chore(antd): bump ant-core to v0.2.3 (#85)

## SDK example/build fixes

- fix(antd-php): use cost-estimate fields in example 02 (#74)
- fix(antd-elixir): print cost-estimate fields in examples (#75)
- fix(antd-lua): add missing discover module to rockspec (#76)
- fix(antd-kotlin): make put-response cost optional + ship gradle wrapper (#77)
- fix(antd-zig): pass payment_mode to dataPutPublic/dataPutPrivate (#79)
- fix(antd-java): make examples runnable via gradle :examples subproject (#80)
- fix(antd-zig): align stdlib API to declared 0.14.x minimum (#82)
- fix(antd-swift): port to Linux + populate cost-estimate fields (#87)

## ant-dev (developer CLI)

- fix(ant-dev): clean up orphan anvil/antnode and stale node identities on stop (#81)
- fix(ant-dev): tooling cluster — flag alias, sys.executable, anvil preflight, README (#83)
- feat(ant-dev): expand `ant dev example` to dispatch all 15 SDKs (#84)
- fix(ant-dev): dispatcher swift no-skip + lua LUA_PATH wrap (#86)
- feat(ant-dev): expose --preset flag on `ant dev start` (default: small) (#88)

## CI / release

- ci: authenticate arduino/setup-protoc on ci.yml too (#60)
- feat(release): publish antd-linux-arm64 artifact (#89)

## Validation

15/15 SDKs round-tripped end-to-end against a daemon built from this
commit on a Linux dev box (Ubuntu 24.04, 0.7.1 atop ant-core v0.2.3).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

antd-lua rockspec missing antd.discover module; require("antd") fails after install

1 participant