sopsencodedsecrets icon indicating copy to clipboard operation
sopsencodedsecrets copied to clipboard

OSX compatibility

Open lopezator opened this issue 6 years ago • 0 comments

Hello, I am using OSX 10.14 along with kustomize v3.0.0, cannot make build work.

When I run:

go build -buildmode plugin -o SopsEncodedSecrets.so SopsEncodedSecrets.go

I get this output:

# command-line-arguments
ld: warning: building for macOS, but linking in object file (/var/folders/6n/q8wt03m13_x3w6v5__mzkwgc0000gn/T/go-link-983033517/go.o) built for

I've used v1alpha1 as apiVersion && SopsEncodedSecrets as kind

It generates the .so file anyway, but If I try to use it, I get:

loading generator plugins: plugin /Users/d.lopez/go/src/my.gitlab.com/myproject/kustomize/plugin/v1alpha1/sopsencodedsecrets/SopsEncodedSecrets fails to load: plugin.Open("/Users/d.lopez/go/src/my.gitlab.com/myproject/kustomize/plugin/v1alpha1/sopsencodedsecrets/SopsEncodedSecrets"): plugin was built with a different version of package unicode/utf8

I compiled then on docker golang:stretch without warnings, but executing a linux build on MacOs, doesn't work also, as expected. In this case, fails with the following error:

plugin.Open("/Users/d.lopez/go/src/my.gitlab.com/myproject/kustomize/plugin/v1alpha1/sopsencodedsecrets/SopsEncodedSecrets.so"): dlopen(/Users/d.lopez/go/src/myproject/kustomize/plugin/v1alpha1/sopsencodedsecrets/SopsEncodedSecrets.so, 10): no suitable image found.  Did find:
	/Users/d.lopez/go/src/my.gitlab.com/myproject/kustomize/plugin/v1alpha1/sopsencodedsecrets/SopsEncodedSecrets.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
	/Users/d.lopez/go/src/my.gitlab.com/myproject/kustomize/plugin/v1alpha1/sopsencodedsecrets/SopsEncodedSecrets.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
make: *** [apply] Error 1

Anything I can do to make this work?

Maybe we should move this issue belongs to the golang repo, unsure about this.

lopezator avatar Jul 11 '19 15:07 lopezator