Open marians opened 7 years ago
From the README:
Currently only supports OS X.
I still need to write a Linux backend. Some ideas are here: https://github.com/lunixbochs/go-keychain/pull/3#issuecomment-216379606
I could also write a stub backend for unsupported platforms (throws registered passwords away) if you just want builds to work.
I'm aware that the keychain is OS X specific. In code, I am using runtime.GOOS == "darwin"
to only enable the function for Mac users.
But does that mean the code cannot be built on Linux?
It needs to link against libsecurity. Can your cross compiler build cgo for OS X? You might be able to make a shim (fake libsecurity that exposes the right symbols), though I'm not sure about linking frameworks from cross-linux.
https://github.com/karalabe/xgo might help
Thanks so far, I'll check out if that is usable for us!
I also just found https://github.com/tmc/keyring which has a native Linux SecretService interface, but shells out to access the OS X keychain
I'm wondering whether go-keychain can be built on Linux.
I am currently testing the use of go-keychain for our CLI. The entire code and PR is here: https://github.com/giantswarm/gsctl/pull/18
The CLI is cross platform and built in a Linux container, where we cross-compile for Linux, Mac, and Windows. However I'm getting this error when attempting a build this way:
Building on Mac OS using
go build
directly works fine.For details on our build command, see here: https://github.com/giantswarm/gsctl/blob/use-mac-keychain/Makefile#L35-L41
If you can answer this easily, I'd appreciate it. Otherwise I can do a more isolated test under Linux on my own.