deps.lua: resolve package name to require() name for luasocket/luaossl/luasec #13

Open
opened 2026-07-18 22:28:10 +02:00 by michael · 0 comments
Owner

Goal

Fix system dependency detection in deps.lua for Lua libraries whose
package/display name differs from their require() name.

Context

module.conf declares system dependencies by package/display name
(e.g. luasocket, luaossl, luasec), matching what
tools/build-stpkg.sh and print_entry() show to the user. deps.lua
checks presence via find_lua_lib(name), which currently only
normalizes one specific case (lua-sql-* -> luasql.*).

For luasocket, luaossl, and luasec, the actual require() name
is socket and ssl respectively -- neither matches the declared
name, and neither is covered by the existing normalization. Result:
deps.check() reports these as missing even when installed (confirmed
on karl: lua54-socket and lua54-sec both present via pacman,
daw-module-smtp install still failed with "unmet system
dependencies").

Acceptance Criteria

  • deps.lua can resolve package/display name to require() name
    for at least luasocket -> socket, luaossl -> ssl,
    luasec -> ssl, alongside the existing lua-sql-* case
  • Approach is generic enough for future one-off cases, not another
    hardcoded special case per dependency
  • daw-modul-smtp installs cleanly via bin/<project> modules install smtp once fixed (regression check)

Notes

Found while installing daw-modul-smtp into kaupapi. Worked around for
now via modules install-local <path>.stpkg, which skips deps.check()
entirely.

## Goal Fix system dependency detection in `deps.lua` for Lua libraries whose package/display name differs from their `require()` name. ## Context `module.conf` declares system dependencies by package/display name (e.g. `luasocket`, `luaossl`, `luasec`), matching what `tools/build-stpkg.sh` and `print_entry()` show to the user. `deps.lua` checks presence via `find_lua_lib(name)`, which currently only normalizes one specific case (`lua-sql-* -> luasql.*`). For `luasocket`, `luaossl`, and `luasec`, the actual `require()` name is `socket` and `ssl` respectively -- neither matches the declared name, and neither is covered by the existing normalization. Result: `deps.check()` reports these as missing even when installed (confirmed on karl: `lua54-socket` and `lua54-sec` both present via pacman, `daw-module-smtp` install still failed with "unmet system dependencies"). ## Acceptance Criteria - [ ] `deps.lua` can resolve package/display name to `require()` name for at least `luasocket -> socket`, `luaossl -> ssl`, `luasec -> ssl`, alongside the existing `lua-sql-*` case - [ ] Approach is generic enough for future one-off cases, not another hardcoded special case per dependency - [ ] `daw-modul-smtp` installs cleanly via `bin/<project> modules install smtp` once fixed (regression check) ## Notes Found while installing `daw-modul-smtp` into kaupapi. Worked around for now via `modules install-local <path>.stpkg`, which skips `deps.check()` entirely.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-module-manager#13
No description provided.