-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: import paths of plugin dependencies redefined using modules #28983
Comments
Yes. (See also #20481.)
If I understand correctly, in general the user must use a build of the plugin that exactly matches the sources and build configuration of the thing it plugs in to. As far as I can tell, the use of modules does not change that fact: it just makes violations easier to detect. |
In fact, if you build all of the plugins from within the That seems strictly preferable to using inconsistent versions of the vendored package and pretending that they're actually identical.
|
Great! Thanks for the tip. |
Yes, fundamentally you have to build the plugin with the same dependencies as the binary. If you build in module mode without local-file replacements, you should be able to run |
Ok, thank you. |
This interferes with plugin loading. See: - golang/go#31278 - golang/go#30531 - golang/go#28983 Signed-off-by: Marcelo E. Magallon <marcelo@sylabs.io>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using plugins with modules has become very restrictive. All common dependencies between plugins and binary that loads them, must be exactly at the same version.
With GOPATH, to avoid that, we can use vendoring because import paths are rewritten. (Ex: gopkg.yaml.v2 is rewritten to package/sub/vendor/gopkg.in/yaml.v2)
But with modules and vendoring, import paths are preserved.
Is this the desired behavior? If so, then the plugins are difficult to use by other users.
Maybe it would be possible to accept that module import paths are rewritten for better modularity, even if it increases the number of dependencies?
In addition, if the vendoring is removed, this feature will be removed too.
Example:
p1/p1.go
main/main.go
script.sh
(Post on golang-nuts: https://groups.google.com/forum/#!topic/golang-nuts/qVg90eU7zfw)
What did you expect to see?
Using module, i would like to redefine import path plugin dependencies, and be able to load several plugins with same dependency at different version (using vendoring?).
What did you see instead?
The text was updated successfully, but these errors were encountered: