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
plugin: cannot load a plugin from a test where the plugin includes the tested package #17928
Comments
|
It cannot be loaded into a test that is inside a package included in the plugin. Try changing your test to a separate package, typically done by replacing the package declaration with |
Already done that in the attached test case - result is the same (it seems that test package name doesn't matter at all). Also plugin cannot be loaded from any package used by the test itself. In my case I've tracked this error while developing https://github.com/wendigo/go-bind-plugin which generates API for wrapping symbols exported by a plugin. I've got package |
Also I've noticed that for mismatched packages like |
Any news @crawshaw? I noticed that sometimes plugin cannot be also loaded outside the test ( |
Ping @crawshaw, @ianlancetaylor |
CL https://golang.org/cl/33925 mentions this issue. |
Fixed for me 👍 Thx @crawshaw |
On #17832 @wendigo notes that a go test for package
p
cannot load a plugin that imports packagep
without an error message about incorrect versions. This example is provided:https://github.com/wendigo/go-plugin-33161
This is caused by the go tool rebuilding a package to include the test files, making the package in the test program incompatible with the equivalent package in the plugin.
I don't think this necessarily needs to work, it is entirely possible to do the plugin work from an external test from a package
p_test
. But maybe we could use a more helpful error message.Any suggestions?
cc @ianlancetaylor
The text was updated successfully, but these errors were encountered: