Skip to content

affected/package: plugin, can't ensure unique plugin name on build #64247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
titpetric opened this issue Nov 17, 2023 · 2 comments
Closed

affected/package: plugin, can't ensure unique plugin name on build #64247

titpetric opened this issue Nov 17, 2023 · 2 comments

Comments

@titpetric
Copy link

We build apps and plugins in the following way to ensure best compatibility:

  • app and go plugin built with -trimpath
  • using a go workspace

An unfortunate side effect of that has lead us to #29525 ;
With using -trimpath, we can't load the same plugin twice. In order to diagnose the issue, we build 2 plugins:

+ go build -buildmode=plugin -o plugin.so
+ go build -buildmode=plugin -trimpath -o plugin-trimpath.so

The version built with -trimpath omitted local filesystem details, however, now there isn't a way to produce a unique plugin without modifications of the go.mod package;

  • without trimpath: /go/src/github.com/<vendor>/<folder>/test_goplugin.go
  • with trimpath: example.com/basic-plugin/test_goplugin.go (matching go.mod)

Is there a way to use -pluginpath to set the current plugin package being built explicitly?
#19418

Could go plugins be considered similarly to dependencies without a go.mod? Creating a pseudoversion for the plugin name in the compiled output?

Is there some other way to make the plugin build unique, to allow for multiple loads?
I would like to avoid tinkering with the binary to inject some timestamp, ID or hash to ensure uniqueness.

What other avenues could be considered to ensure a plugin can be reloaded?

@seankhliao
Copy link
Member

Duplicate of #29525

@seankhliao seankhliao marked this as a duplicate of #29525 Nov 17, 2023
@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
@golang golang locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants