-
Notifications
You must be signed in to change notification settings - Fork 0
Plugin not loaded from compiled binary when .so is in plugin root directory #255
Description
Bug Report: Plugin loader ignores .so in plugin root; aro_plugin_info() missing verbs key causes silent action registration failure
ARO Version: (latest from ghcr.io/arolang/aro-buildsystem:latest)
Platform: Linux ARM64 (aarch64)
Summary
Two bugs prevent C/Rust plugins from working with aro build compiled binaries:
-
loadPrecompiledManagedPluginsonly scanssrc/,Sources/,target/release/— any.soplaced directly in the plugin root (Plugins/<name>/lib<name>.so) is silently ignored. -
aro_plugin_info()actions must include a"verbs"key — if only"name"is present, the plugin loads successfully but its actions are never registered in the action registry, causingUnknown action verb: 'postgres.execute'at runtime.
Steps to Reproduce
- Create a C-ABI plugin (
aro_plugin_info,aro_plugin_execute,aro_plugin_free,aro_plugin_qualifier) and place the compiled.soatPlugins/postgres/libpostgres.so - Use
type: c-plugininplugin.yamlwithpath: "." - Have
aro_plugin_info()return:{"name":"postgres","actions":[{"name":"execute"},{"name":"query"}]} - Run
aro build .and execute the compiled binary
Expected: Plugin loads and Postgres.Execute dispatches correctly
Actual: Runtime error: Unknown action verb: 'postgres.execute'
Root Causes
Bug 1: In PluginLoader.loadPrecompiledManagedPlugins, only three subdirectories are scanned for .so files: src/, Sources/, and target/release/. The plugin root is never checked.
Bug 2: In the loadCPlugin function (or equivalent), action registration skips entries that don't have a "verbs" key:
guard let verbs = actionDef["verbs"] as? [String] else { continue }This means the common {"name": "execute"} format (without "verbs") silently skips registration.
Workarounds Found
- Place the pre-compiled
.soatPlugins/<name>/target/release/lib<name>.so - Add
"verbs": ["execute"]and"prepositions": ["on", "with"]to each action inaro_plugin_info() - Use lowercase
handle:inplugin.yaml(e.g.,handle: postgres) to match the normalized action keypostgres.execute
Plugin ABI Notes
The aro_plugin_qualifier function must accept two const char* arguments (not one):
char* aro_plugin_qualifier(const char* qualifier_name, const char* input_json);The documentation/examples should clarify this signature.