Skip to content

Plugin not loaded from compiled binary when .so is in plugin root directory #255

@KrisSimon

Description

@KrisSimon

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:

  1. loadPrecompiledManagedPlugins only scans src/, Sources/, target/release/ — any .so placed directly in the plugin root (Plugins/<name>/lib<name>.so) is silently ignored.

  2. 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, causing Unknown action verb: 'postgres.execute' at runtime.

Steps to Reproduce

  1. Create a C-ABI plugin (aro_plugin_info, aro_plugin_execute, aro_plugin_free, aro_plugin_qualifier) and place the compiled .so at Plugins/postgres/libpostgres.so
  2. Use type: c-plugin in plugin.yaml with path: "."
  3. Have aro_plugin_info() return: {"name":"postgres","actions":[{"name":"execute"},{"name":"query"}]}
  4. 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

  1. Place the pre-compiled .so at Plugins/<name>/target/release/lib<name>.so
  2. Add "verbs": ["execute"] and "prepositions": ["on", "with"] to each action in aro_plugin_info()
  3. Use lowercase handle: in plugin.yaml (e.g., handle: postgres) to match the normalized action key postgres.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpgPostgreSQL / database plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions