Skip to content

build: add lua-cjson submodule and fix make bench for macOS#16

Merged
membphis merged 1 commit into
mainfrom
worktree-foamy-chasing-oasis
May 16, 2026
Merged

build: add lua-cjson submodule and fix make bench for macOS#16
membphis merged 1 commit into
mainfrom
worktree-foamy-chasing-oasis

Conversation

@membphis
Copy link
Copy Markdown
Collaborator

Summary

  • Add vendor/lua-cjson as a git submodule pointing to https://github.com/openresty/lua-cjson
  • Fix make bench on macOS: use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH (macOS SIP ignores LD_LIBRARY_PATH, so ffi.load("quickdecode") was failing)
  • Auto-build vendor/lua-cjson/cjson.so as a bench prerequisite; uses -bundle -undefined dynamic_lookup on Darwin
  • Prepend ./vendor/lua-cjson/?.so to LUA_CPATH so require("cjson") resolves without a system install

Test plan

  • make bench runs end-to-end on macOS (Apple Silicon + Homebrew LuaJIT)
  • make bench still works on Linux (LD_LIBRARY_PATH path unchanged)
  • make build and make test unaffected

- Add vendor/lua-cjson as a git submodule (openresty/lua-cjson)
- Switch LUA_ENV to use DYLD_LIBRARY_PATH on Darwin (LD_LIBRARY_PATH
  is ignored by macOS SIP and dyld)
- Prepend vendor/lua-cjson/?.so to LUA_CPATH so require("cjson") resolves
- Add LUAJIT_PREFIX / LUAJIT_INC derivation from the luajit binary path
- Add vendor/lua-cjson/cjson.so target; builds with -bundle -undefined
  dynamic_lookup on macOS (required by dyld for extension modules)
- Make bench depend on vendor/lua-cjson/cjson.so so it auto-builds cjson
@membphis membphis merged commit c7fe157 into main May 16, 2026
2 checks passed
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