deps: remove postgresql version detection, fix io.popen usage #11

Open
opened 2026-05-26 05:23:28 +02:00 by michael · 1 comment
Owner

Findings

1. Wrong prefix in header comment

src/daw/module_manager/deps.lua should be deps.lua (no src/ prefix).

2. Direct io.popen calls

find_binary() and get_postgresql_major() use io.popen directly.
Must be replaced with out:run_rc() via daw.common.sys.

3. Hardcoded postgresql version detection

get_postgresql_major() and the postgresql special case in
is_present() implement OS-specific version detection via
pg_config and psql. This violates the DAW architecture rule:
no OS detection at runtime, no project-specific exceptions.

The module manager checks presence only -- not versions.
Both functions must be removed entirely.

Acceptance Criteria

  • Header comment path corrected
  • io.popen replaced with out:run_rc() via daw.common.sys
  • get_postgresql_major() removed
  • postgresql special case in is_present() removed
  • Tests pass after changes
## Findings ### 1. Wrong prefix in header comment `src/daw/module_manager/deps.lua` should be `deps.lua` (no `src/` prefix). ### 2. Direct io.popen calls `find_binary()` and `get_postgresql_major()` use `io.popen` directly. Must be replaced with `out:run_rc()` via `daw.common.sys`. ### 3. Hardcoded postgresql version detection `get_postgresql_major()` and the `postgresql` special case in `is_present()` implement OS-specific version detection via `pg_config` and `psql`. This violates the DAW architecture rule: no OS detection at runtime, no project-specific exceptions. The module manager checks presence only -- not versions. Both functions must be removed entirely. ## Acceptance Criteria - [ ] Header comment path corrected - [ ] `io.popen` replaced with `out:run_rc()` via daw.common.sys - [ ] `get_postgresql_major()` removed - [ ] `postgresql` special case in `is_present()` removed - [ ] Tests pass after changes
Author
Owner

Note: version checking belongs in daw.common

System dependency version checking (e.g. postgresql major version via
pg_config/psql) is not lost -- it belongs in daw.common as a generic
utility, not in the module manager.

A future daw.common module (e.g. daw.common.syscheck or similar) could
provide version detection for known system dependencies.
The module manager would then call that, without any OS-specific logic
of its own.

## Note: version checking belongs in daw.common System dependency version checking (e.g. postgresql major version via pg_config/psql) is not lost -- it belongs in daw.common as a generic utility, not in the module manager. A future daw.common module (e.g. daw.common.syscheck or similar) could provide version detection for known system dependencies. The module manager would then call that, without any OS-specific logic of its own.
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#11
No description provided.