Open urso opened 7 years ago
Cross compiling plugins needs to use external linking, and therefore you need to have cross compiling toolchain for the target platform installed.
i.e. for the first case, you need linux toolchain installed on Darwin and for the 2nd case, you need darwin toolchain install on Linux.
Should the go tool emit a more helpful error message after the existing failure messages?
Or is there missing documentation?
/cc @ianlancetaylor @crawshaw
Related issues:
is required
maybe we can merge this one into #16395?
Better error handling is covered by #16395, any solution to that will work here.
There are two potential feature requests here, the first is internal linking of plugins which don't use cgo when GOOS=linux, the second is the same for GOOS=darwin.
Let's turn this issue into a feature request for GOOS=linux, -buildmode=plugin internal linking. It's not a priority for me, but it's an entirely reasonable feature request.
@urso if you want, you can file a separate bug for GOOS=darwin, -buildmode=plugin internal linking.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?(1.8beta1) go version devel +41908a5 Thu Dec 1 02:54:21 2016 +0000 darwin/amd64
What operating system and processor architecture are you using (
go env
)?Darwin:
Linux:
What did you do?
Try to cross compile the plugin by setting GOOS=linux (darwin)
What did you expect to see?
plugin being build
What did you see instead?
Darwin:
Linux: