Skip to content

fix(config): respect -drivers flag when resolving Lua paths - #83

Merged
erikarenhill merged 1 commit into
masterfrom
fix/drivers-dir-lua-resolution
Apr 17, 2026
Merged

erikarenhill merged 1 commit into
masterfrom
fix/drivers-dir-lua-resolution

Conversation

@erikarenhill

Copy link
Copy Markdown
Collaborator

The earlier -drivers flag only fixed the catalog scan. Driver spawn still went through config.ResolveDriverPaths, which joins relative Lua paths with the config directory — so in Docker a YAML entry of drivers/pixii.lua became /app/data/drivers/pixii.lua (the bind- mounted data volume), while drivers actually ship at /app/drivers inside the immutable image. Result: every driver add/reload failed with open /app/data/drivers/<file>.lua: no such file or directory.

Add config.DriversDirOverride, a package-level string that main.go sets once from resolveDriverDir(). When set, any relative Lua path starting with drivers/ resolves through the override instead of baseDir. UnresolveDriverPaths + relDriverPath mirror the same logic so the YAML + UI round-trip stays portable — paths come back as drivers/<name>.lua rather than absolute /app/drivers/....

Empty override preserves the historical behaviour, so local dev (make dev) and every existing test still works unchanged.

The earlier -drivers flag only fixed the catalog scan. Driver *spawn*
still went through config.ResolveDriverPaths, which joins relative
Lua paths with the config directory — so in Docker a YAML entry of
`drivers/pixii.lua` became `/app/data/drivers/pixii.lua` (the bind-
mounted data volume), while drivers actually ship at `/app/drivers`
inside the immutable image. Result: every driver add/reload failed
with `open /app/data/drivers/<file>.lua: no such file or directory`.

Add `config.DriversDirOverride`, a package-level string that main.go
sets once from resolveDriverDir(). When set, any relative Lua path
starting with `drivers/` resolves through the override instead of
baseDir. `UnresolveDriverPaths` + `relDriverPath` mirror the same
logic so the YAML + UI round-trip stays portable — paths come back
as `drivers/<name>.lua` rather than absolute `/app/drivers/...`.

Empty override preserves the historical behaviour, so local dev
(`make dev`) and every existing test still works unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@erikarenhill
erikarenhill merged commit 881ddbd into master Apr 17, 2026
1 check passed
@erikarenhill
erikarenhill deleted the fix/drivers-dir-lua-resolution branch April 17, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant