Files
archie/internal/plugin/pluginextract/pluginextract.go
T
sam 71d026feb2 fix(yaegiutil): refuse incomplete Yaegi interface wrappers at load
The generated symbol tables carried 25 hand-added nil guards across three
packages, re-applied by hand after every regeneration because `yaegi extract`
does not emit them. Regeneration silently dropped them, and three package docs
instructed the next agent to put them back.

The guards also answered the wrong way. A nil WResolve returned ("", nil), so a
malformed secret engine served an empty secret and reported success; a nil
WStop reported a clean shutdown for a module that never ran one.

Reject the wrapper where it enters the daemon instead. Yaegi type-checks
"var X Iface = impl{}" and refuses an incomplete impl on its own, but the
wrapper type is exported into the symbol table, so interpreted code can build
one directly and struct-literal semantics leave the omitted method nil.
Resolve now names the missing method and skips the plugin.

Generated tables are used verbatim again. Also names the wanted type on a
failed assertion, which formatted as "want <nil>" for every interface target.
2026-09-20 12:05:39 +10:00

15 lines
682 B
Go

// Package pluginextract holds the Yaegi symbol table for internal/plugin,
// generated by `go generate`. Kept separate from internal/plugin itself
// so the generated file can import it without a self-import cycle.
//
// The generated file is used verbatim. A wrapper whose method fields are not
// all populated is refused in yaegiutil.Resolve, so it needs no hand-added
// nil-guards -- an earlier convention that every regeneration silently undid.
package pluginextract
import "reflect"
//go:generate go run github.com/traefik/yaegi/cmd/yaegi extract -name pluginextract github.com/samcharles93/archie-core/internal/plugin
var Symbols = map[string]map[string]reflect.Value{}