diff options
| author | Jeff Carr <[email protected]> | 2025-08-17 15:28:11 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-17 22:57:06 -0500 |
| commit | bd5b16d8755bc9e5f0dc90162bc4724d319c725e (patch) | |
| tree | 4b7f532675d29493f78b8ab41c0bb925158ee768 /plugincheck/check.go | |
| parent | edb3e23311b9cd667898e625b07f5dbeb43e30e3 (diff) | |
show drives. remove stupid commit of plugin binary. damnit
Diffstat (limited to 'plugincheck/check.go')
| -rw-r--r-- | plugincheck/check.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/plugincheck/check.go b/plugincheck/check.go deleted file mode 100644 index 8d3b683..0000000 --- a/plugincheck/check.go +++ /dev/null @@ -1,47 +0,0 @@ -package plugincheck - -import ( - "debug/buildinfo" - "errors" - "fmt" - "runtime/debug" -) - -// CheckPluginCompatibility verifies that the plugin .so file was built -// with the same Go version and dependency versions as the host binary. -func CheckPluginCompatibility(pluginPath string) error { - pluginInfo, err := buildinfo.ReadFile(pluginPath) - if err != nil { - return fmt.Errorf("failed to read plugin build info: %w", err) - } - - mainInfo, ok := debug.ReadBuildInfo() - if !ok { - return errors.New("failed to read main binary build info") - } - - if pluginInfo.GoVersion != mainInfo.GoVersion { - return fmt.Errorf("Go version mismatch: plugin=%s, host=%s", - pluginInfo.GoVersion, mainInfo.GoVersion) - } - - // Create a map of main binary dependencies for quick lookup - hostDeps := make(map[string]string) - for _, dep := range mainInfo.Deps { - hostDeps[dep.Path] = dep.Version - } - - // Compare plugin dependencies - for _, dep := range pluginInfo.Deps { - hostVer, ok := hostDeps[dep.Path] - if !ok { - return fmt.Errorf("dependency %s not found in host binary", dep.Path) - } - if dep.Version != hostVer { - return fmt.Errorf("dependency version mismatch for %s: plugin=%s, host=%s", - dep.Path, dep.Version, hostVer) - } - } - - return nil -} |
