build: add lua-cjson submodule and fix make bench for macOS#16
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vendor/lua-cjsonas a git submodule pointing to https://github.com/openresty/lua-cjsonmake benchon macOS: useDYLD_LIBRARY_PATHinstead ofLD_LIBRARY_PATH(macOS SIP ignoresLD_LIBRARY_PATH, soffi.load("quickdecode")was failing)vendor/lua-cjson/cjson.soas a bench prerequisite; uses-bundle -undefined dynamic_lookupon Darwin./vendor/lua-cjson/?.sotoLUA_CPATHsorequire("cjson")resolves without a system installTest plan
make benchruns end-to-end on macOS (Apple Silicon + Homebrew LuaJIT)make benchstill works on Linux (LD_LIBRARY_PATH path unchanged)make buildandmake testunaffected