Fix CI LuaRocks module paths - #7
Conversation
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/ci.yml">
<violation number="1" location=".github/workflows/ci.yml:38">
P2: The `eval "$(luarocks path)"` before `make test` has no effect on Lua-rock modules because the Makefile redefines and exports LUA_PATH (`LUA_PATH := ./lua/?.lua;./lua/?/init.lua;;`). Inside make recipes the exported LUA_PATH is the Makefile value, so pure-Lua rock modules such as `dkjson` and the `socket.http` Lua wrapper still are not resolvable during `make test`; only C modules (.so) resolve via LUA_CPATH, which make does not override. Make the rocks path part of the Makefile's LUA_PATH (e.g. append `$(shell luarocks path --lr-path)` in the Makefile) instead of relying on the shell eval, which the Makefile overrides.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| - name: Verify JSON dependencies | ||
| - name: Verify dependencies | ||
| run: | | ||
| eval "$(luarocks path)" |
There was a problem hiding this comment.
P2: The eval "$(luarocks path)" before make test has no effect on Lua-rock modules because the Makefile redefines and exports LUA_PATH (LUA_PATH := ./lua/?.lua;./lua/?/init.lua;;). Inside make recipes the exported LUA_PATH is the Makefile value, so pure-Lua rock modules such as dkjson and the socket.http Lua wrapper still are not resolvable during make test; only C modules (.so) resolve via LUA_CPATH, which make does not override. Make the rocks path part of the Makefile's LUA_PATH (e.g. append $(shell luarocks path --lr-path) in the Makefile) instead of relying on the shell eval, which the Makefile overrides.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 38:
<comment>The `eval "$(luarocks path)"` before `make test` has no effect on Lua-rock modules because the Makefile redefines and exports LUA_PATH (`LUA_PATH := ./lua/?.lua;./lua/?/init.lua;;`). Inside make recipes the exported LUA_PATH is the Makefile value, so pure-Lua rock modules such as `dkjson` and the `socket.http` Lua wrapper still are not resolvable during `make test`; only C modules (.so) resolve via LUA_CPATH, which make does not override. Make the rocks path part of the Makefile's LUA_PATH (e.g. append `$(shell luarocks path --lr-path)` in the Makefile) instead of relying on the shell eval, which the Makefile overrides.</comment>
<file context>
@@ -33,12 +33,15 @@ jobs:
- - name: Verify JSON dependencies
+ - name: Verify dependencies
run: |
+ eval "$(luarocks path)"
+ lua -e "assert(require('socket.http'))"
lua -e "assert(require('dkjson'))"
</file context>
Summary by cubic
Fixes CI so LuaRocks-installed modules are found by the Lua interpreter and makes a missing
socket.httperror clearer.LUA_PATHfrom the same tree somaketargets also see the dependencies.socket.httpalongside the existingdkjsonandcjson.safechecks, and includes the underlying error when it's missing.Written for commit c68bc65. Summary will update on new commits.