2026-04-06 09:00:47 +00:00
|
|
|
//go:build !wazero
|
|
|
|
|
|
|
|
|
|
// Default plugin runtime: no Wazero. Plugin manifests are still discovered,
|
|
|
|
|
// persisted, and surfaced through the admin API, but `.wasm` modules are not
|
|
|
|
|
// executed. To enable real WASM execution build with `-tags wazero`.
|
2026-07-18 12:55:22 +02:00
|
|
|
|
2026-04-06 09:00:47 +00:00
|
|
|
package plugin
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
)
|
|
|
|
|
|
2026-04-06 21:46:22 +00:00
|
|
|
// platformInit is a no-op in the default build — there is no Wazero runtime
|
|
|
|
|
// to stand up, and NewRegistry leaves runtimePlatform nil so the lifecycle
|
|
|
|
|
// methods fall through to ErrRuntimeUnavailable.
|
|
|
|
|
func platformInit(_ Config) (any, func(context.Context) error, error) {
|
|
|
|
|
return nil, nil, nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-06 09:00:47 +00:00
|
|
|
// activateWithRuntime is a no-op in the default build. It is only called from
|
|
|
|
|
// Registry.activate when runtimePlatform is non-nil, which never happens here.
|
2026-04-06 21:46:22 +00:00
|
|
|
func (r *Registry) activateWithRuntime(_ context.Context, _ any, _ *Instance) error {
|
2026-04-06 09:00:47 +00:00
|
|
|
return ErrRuntimeUnavailable
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-06 21:46:22 +00:00
|
|
|
// platformDeactivate is called from Close on each plugin; a no-op here.
|
2026-07-23 17:03:52 +02:00
|
|
|
func (r *Registry) platformDeactivate(_ context.Context, _ *Instance) {}
|
2026-04-06 21:46:22 +00:00
|
|
|
|
2026-04-06 09:00:47 +00:00
|
|
|
// invokeCommand returns an error result instructing the operator to enable
|
|
|
|
|
// the wazero build tag. Default build only.
|
2026-04-06 21:46:22 +00:00
|
|
|
func (r *Registry) invokeCommand(_ context.Context, _ *Instance, _, _ int64, _ string, _ []string) (*CommandResult, bool) {
|
2026-04-06 09:00:47 +00:00
|
|
|
return &CommandResult{
|
|
|
|
|
Reply: "plugin runtime disabled — rebuild server with -tags wazero to execute plugin commands",
|
|
|
|
|
}, true
|
|
|
|
|
}
|