Background
luarocks install lua-qjson builds the Rust native library at install time, so
the install environment needs Rust/Cargo (README §Installing). The original
framing of this issue assumed the goal was to make the install step itself
Rust-free, via pre-built binaries shipped to GitHub Releases / LuaRocks.
After discussion, that is not the actual requirement. qjson's runtime
dependency is only the compiled libqjson.so + the Lua wrappers + LuaJIT —
Rust is a pure build-time dependency. The real need is simply: the runtime
environment (e.g. a production APISIX image) must not carry Rust, while having
Rust in the build environment is perfectly acceptable.
This is a textbook build/runtime separation, which the current toolchain already
supports today — it's just undocumented. The gap is documentation, not missing
distribution machinery.
Goal
Document how to deploy qjson so that the runtime environment contains no Rust
toolchain, by separating the build stage (has Rust, runs luarocks install)
from the runtime stage (only the compiled artifacts + LuaJIT).
Non-goals
- Pre-built binaries on GitHub Releases / LuaRocks (original Option A/B/C).
- Cross-compilation matrix or changes to
release.yml.
- Making the
luarocks install step itself Rust-free.
These remain possible future work (a separate "prebuilt distribution" issue) if
demand from third-party luarocks install users ever materializes — but they
are explicitly out of scope here.
Acceptance Criteria
Task Checklist
1. Documentation
2. Verification
Notes / Decisions
- The original pre-built-binary framing was a generic comparison-to-lua-cjson
idea (auto-generated issue), larger than the actual need.
- Confirmed requirement: Rust at
luarocks install time is acceptable; only the
runtime must be Rust-free.
- Mechanism:
luarocks install --tree=/qjson-rock lua-qjson in a builder stage,
then COPY --from=builder /qjson-rock /usr/local/ into a Rust-free runtime.
Background
luarocks install lua-qjsonbuilds the Rust native library at install time, sothe install environment needs Rust/Cargo (README §Installing). The original
framing of this issue assumed the goal was to make the install step itself
Rust-free, via pre-built binaries shipped to GitHub Releases / LuaRocks.
After discussion, that is not the actual requirement. qjson's runtime
dependency is only the compiled
libqjson.so+ the Lua wrappers + LuaJIT —Rust is a pure build-time dependency. The real need is simply: the runtime
environment (e.g. a production APISIX image) must not carry Rust, while having
Rust in the build environment is perfectly acceptable.
This is a textbook build/runtime separation, which the current toolchain already
supports today — it's just undocumented. The gap is documentation, not missing
distribution machinery.
Goal
Document how to deploy qjson so that the runtime environment contains no Rust
toolchain, by separating the build stage (has Rust, runs
luarocks install)from the runtime stage (only the compiled artifacts + LuaJIT).
Non-goals
release.yml.luarocks installstep itself Rust-free.These remain possible future work (a separate "prebuilt distribution" issue) if
demand from third-party
luarocks installusers ever materializes — but theyare explicitly out of scope here.
Acceptance Criteria
qjson.so,qjson.lua,qjson/lib.lua,qjson/table.lua, plus LuaJITluarocks install --tree=<dir>to stage artifacts into one directory for a cleanCOPYcargo/rustccanrequire("qjson")and parse successfullyTask Checklist
1. Documentation
2. Verification
require("qjson")works in a runtime stage with no Rust toolchainNotes / Decisions
idea (auto-generated issue), larger than the actual need.
luarocks installtime is acceptable; only theruntime must be Rust-free.
luarocks install --tree=/qjson-rock lua-qjsonin a builder stage,then
COPY --from=builder /qjson-rock /usr/local/into a Rust-free runtime.