Command to check all installed modules against their module and library requirements #32

Closed
opened 2026-11-21 09:40:48 +01:00 by michael · 4 comments
Owner

Problem

The dependency checks run only when a module is installed or updated
(install/init.lua: deps, module_deps, lib_deps). Nothing checks the
modules that are already installed. The Lua libraries (daw-lua-common and
others) are kept by hand; if one is replaced by an older or newer version, no
command reports which installed modules no longer fit. The failure shows up
at run time, in the module that uses the library.

DAW/daw-module-manager#31 added the check for requires.lua at install time.
This is the same check for the installed state.

Scope

  • a command (check, or an option of verify) that goes through all installed modules
  • for each module: requires.module (installed module in range) and requires.lua (library loads, version in range)
  • report per module and dependency: id, reason (absent, version_out_of_range, version_unreadable), min, max, found
  • exit code and output usable in a script; read only, changes nothing
  • reuse install/lib_deps.lua and install/module_deps.lua; no second implementation of the range logic

Acceptance criteria

  • tests first: all dependencies met gives an empty report and success
  • tests first: a library older than min of an installed module is reported with module, library, min and found
  • tests first: a library without version and a missing module are reported with their own reason
  • a module without requires is not reported
  • make test passes (Lua 5.4 and 5.1)

Technical notes

  • open: where the requirements of an installed module are read from (the manifest it was installed from, or its module.conf); the stored data has to carry requires.lua with require, min, max
  • the libraries have no installer; the report is the only hint that a library needs to be brought up first
## Problem The dependency checks run only when a module is installed or updated (`install/init.lua`: `deps`, `module_deps`, `lib_deps`). Nothing checks the modules that are already installed. The Lua libraries (daw-lua-common and others) are kept by hand; if one is replaced by an older or newer version, no command reports which installed modules no longer fit. The failure shows up at run time, in the module that uses the library. DAW/daw-module-manager#31 added the check for `requires.lua` at install time. This is the same check for the installed state. ## Scope - a command (`check`, or an option of `verify`) that goes through all installed modules - for each module: `requires.module` (installed module in range) and `requires.lua` (library loads, `version` in range) - report per module and dependency: id, reason (`absent`, `version_out_of_range`, `version_unreadable`), `min`, `max`, `found` - exit code and output usable in a script; read only, changes nothing - reuse `install/lib_deps.lua` and `install/module_deps.lua`; no second implementation of the range logic ## Acceptance criteria - [ ] tests first: all dependencies met gives an empty report and success - [ ] tests first: a library older than `min` of an installed module is reported with module, library, `min` and `found` - [ ] tests first: a library without `version` and a missing module are reported with their own reason - [ ] a module without `requires` is not reported - [ ] `make test` passes (Lua 5.4 and 5.1) ## Technical notes - open: where the requirements of an installed module are read from (the manifest it was installed from, or its `module.conf`); the stored data has to carry `requires.lua` with `require`, `min`, `max` - the libraries have no installer; the report is the only hint that a library needs to be brought up first
Author
Owner

Decision (2026-11-21): the requirements of an installed module are read from its installed config/module.conf, not from the manifest. Reasons: the manifest of an installed module carries no requires (it has signed_with, module, version and the file list); the index entry is built from module.conf by the index writer, so the installed copy holds the same data; module_deps.graph already reads requires.module from the installed module.conf.

Shape: from the parsed module.conf of the installed module the same structure as in the index entry is built, entry.requires.lua = { [lib] = { require, min, max } }, so that install/lib_deps.lua stays the only place of the range logic. For this a function analogous to module_deps.required(conf) is added to install/lib_deps.lua.

Still open: name of the command (check, or an option of verify).

Decision (2026-11-21): the requirements of an installed module are read from its installed config/module.conf, not from the manifest. Reasons: the manifest of an installed module carries no requires (it has signed_with, module, version and the file list); the index entry is built from module.conf by the index writer, so the installed copy holds the same data; module_deps.graph already reads requires.module from the installed module.conf. Shape: from the parsed module.conf of the installed module the same structure as in the index entry is built, entry.requires.lua = { [lib] = { require, min, max } }, so that install/lib_deps.lua stays the only place of the range logic. For this a function analogous to module_deps.required(conf) is added to install/lib_deps.lua. Still open: name of the command (check, or an option of verify).
Author
Owner

Status (2026-11-21): the module side is implemented on develop (feat(checkdeps), 2b92638, and the fragjan marker comments, 419f47c). mm.checkdeps(opts) and the command 'modules checkdeps' read config/module.conf of every installed module and check requires.module and requires.lua with the range logic of install/module_deps.lua and install/lib_deps.lua, one dependency at a time. Result: status dependencies_met | dependencies_unmet, checked, problems (id, kind, dependency, reason, min, max, found) and optional warnings (module_broken, check_failed). All acceptance criteria are met in the module; make test passes on Lua 5.4 and 5.1.

Not done, and not part of this repository: the host. In DAW/fragjan, adapters/ui/results.lua does not know the two statuses; an unknown status is shown as module_status_unknown with the warning exit code, also when everything is met. Still to do there: show problems and warnings, and the exit code of dependencies_unmet (open: which one). The check_failed warning carries a dependency field that the generic warning line does not show. Waits for the fragjan migration. The issue stays open until the host side exists.

Status (2026-11-21): the module side is implemented on develop (feat(checkdeps), 2b92638, and the fragjan marker comments, 419f47c). mm.checkdeps(opts) and the command 'modules checkdeps' read config/module.conf of every installed module and check requires.module and requires.lua with the range logic of install/module_deps.lua and install/lib_deps.lua, one dependency at a time. Result: status dependencies_met | dependencies_unmet, checked, problems (id, kind, dependency, reason, min, max, found) and optional warnings (module_broken, check_failed). All acceptance criteria are met in the module; make test passes on Lua 5.4 and 5.1. Not done, and not part of this repository: the host. In DAW/fragjan, adapters/ui/results.lua does not know the two statuses; an unknown status is shown as module_status_unknown with the warning exit code, also when everything is met. Still to do there: show problems and warnings, and the exit code of dependencies_unmet (open: which one). The check_failed warning carries a dependency field that the generic warning line does not show. Waits for the fragjan migration. The issue stays open until the host side exists.
Author
Owner

Correction to the status comment above: the host part is not a new task for DAW/fragjan, and checkdeps must not get its own branch in adapters/ui/results.lua. That file compares against fixed status literals, which is already tracked as DAW/fragjan#154 (result kinds must come from data, a new kind needs no code change). How warnings and errors reach the screen for every module is tracked in DAW/daw-contracts#24. Related: DAW/fragjan#155 and DAW/fragjan#156.

So for this issue: the module side is done (see the status comment). What the user sees for dependencies_met / dependencies_unmet (problems, warnings, exit code) follows from DAW/fragjan#154 and DAW/daw-contracts#24 and is decided there. The issue stays open until the host shows the result without a change for checkdeps.

Correction to the status comment above: the host part is not a new task for DAW/fragjan, and checkdeps must not get its own branch in adapters/ui/results.lua. That file compares against fixed status literals, which is already tracked as DAW/fragjan#154 (result kinds must come from data, a new kind needs no code change). How warnings and errors reach the screen for every module is tracked in DAW/daw-contracts#24. Related: DAW/fragjan#155 and DAW/fragjan#156. So for this issue: the module side is done (see the status comment). What the user sees for dependencies_met / dependencies_unmet (problems, warnings, exit code) follows from DAW/fragjan#154 and DAW/daw-contracts#24 and is decided there. The issue stays open until the host shows the result without a change for checkdeps.
Author
Owner

Closing 2026-11-21

  • tests first: all dependencies met gives status dependencies_met and an empty problems list
  • tests first: a library older than min is reported with module, library, min and found
  • tests first: a library without version and a missing module are reported with their own reason
  • a module without requires is not reported
  • make test passes (Lua 5.4 and 5.1)

Implemented as the command 'modules checkdeps' (mm.checkdeps(opts)), on develop in 2b92638 and 419f47c. The range logic stays in install/lib_deps.lua and install/module_deps.lua.

Not part of this issue: how a host shows the result (status, problems, warnings, exit code). That follows from DAW/fragjan#154 and DAW/daw-contracts#24.

## Closing 2026-11-21 - [x] tests first: all dependencies met gives status dependencies_met and an empty problems list - [x] tests first: a library older than min is reported with module, library, min and found - [x] tests first: a library without version and a missing module are reported with their own reason - [x] a module without requires is not reported - [x] make test passes (Lua 5.4 and 5.1) Implemented as the command 'modules checkdeps' (mm.checkdeps(opts)), on develop in 2b92638 and 419f47c. The range logic stays in install/lib_deps.lua and install/module_deps.lua. Not part of this issue: how a host shows the result (status, problems, warnings, exit code). That follows from DAW/fragjan#154 and DAW/daw-contracts#24.
michael 2026-11-21 13:01:05 +01:00
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#32
No description provided.