Skip to content

rockspec: Add lua-resty-string dependency - #353

Merged
sriemer merged 1 commit into
masterfrom
lua-resty-string-depend
Nov 17, 2026
Merged

sriemer merged 1 commit into
masterfrom
lua-resty-string-depend

Conversation

@sriemer

@sriemer sriemer commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Report: add lua-resty-string to the rockspec

Summary

User @leona-ya reported in #352 that lua-resty-string is required as a dependency of lua-resty-http. The code confirms this. The package was added to dependencies in lua-resty-http-0.18.0-0.rockspec and validated using the Docker setup described in DOCKER_BUILD.md.

Code verification

Package Location Usage Kind
lua-resty-string lib/resty/http_connect.lua:8 require("resty.string").to_hex at module load time Hard dependency
  • This is the only reference to resty.string in the Lua sources.
  • It is an unconditional require, so resty.http_connect cannot load without the package.

Change

lua-resty-http-0.18.0-0.rockspec:

 dependencies = {
-    "lua >= 5.1"
+    "lua >= 5.1",
+    "lua-resty-string"
 }

No version constraint was added, because the code requires no specific minimum version.

Validation

The image was built with docker build -t lua-resty-http-builder:test . and the checks below were run in the container.

Check Result
luarocks lint lua-resty-http-0.18.0-0.rockspec Passed
luarocks install --deps-only lua-resty-http-0.18.0-0.rockspec Passed. lua-resty-string 0.09-0 was resolved and installed.
luacheck lib 0 warnings / 0 errors in 3 files
make coverage 21 test files, 434 tests, all passed

Coverage:

File Hits Missed Coverage
lib/resty/http.lua 500 68 88.03%
lib/resty/http_connect.lua 95 67 58.64%
lib/resty/http_headers.lua 14 0 100.00%
Total 609 135 81.85%

The lint and --deps-only steps are not in DOCKER_BUILD.md. They were added to check the rockspec itself.

Notes

  • lua-resty-openssl was not added in this change. lib/resty/http_connect.lua:14-18 loads resty.openssl.* inside an xpcall, so a missing module only logs a warning and disables mTLS. The README calls it "a prerequisite for all HTTP connections", so it could be added as a regular dependency if desired.
  • The Dockerfile installs lua-resty-openssl but not lua-resty-string. The OpenResty base image already provides resty.string, so the tests pass either way. The rockspec entry matters for plain luarocks install outside OpenResty.
  • The only modified tracked file is lua-resty-http-0.18.0-0.rockspec.

`lib/resty/http_connect.lua` requires `resty.string` at load time.

Usually the dependency is already installed with OpenResty.
Issues can only occur if the rock is used outside of OpenResty.

Fixes #352
@sriemer

sriemer commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Trivial. No review required. Developed and tested with the help of IBM Bob Shell 2.1.0. So merging.

@sriemer
sriemer merged commit 89b4445 into master Nov 17, 2026
12 checks passed
@sriemer sriemer self-assigned this Nov 17, 2026
@sriemer sriemer added the bugfix label Nov 17, 2026
@sriemer
sriemer deleted the lua-resty-string-depend branch November 17, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant