keybase-issues
keybase-issues copied to clipboard
Go project using go-keychain fails with GOOS=linux
I was trying to build some tooling using keybase/go-keychain to interact with keychain, since the README seemed to indicate that it also worked in Linux (I assumed that it was with a system keyring).
However, when trying to build my project on my mac I get the following. I'm pretty new to the Go world, I apologise if this is something really dummy.
Go 1.23.6 MacOS 15.3.1 / Darwin 24.3
❯ CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -v ./...
runtime/cgo
# runtime/cgo
linux_syscall.c:67:13: error: call to undeclared function 'setresgid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
linux_syscall.c:67:13: note: did you mean 'setregid'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:593:6: note: 'setregid' declared here
linux_syscall.c:73:13: error: call to undeclared function 'setresuid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
linux_syscall.c:73:13: note: did you mean 'setreuid'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:595:6: note: 'setreuid' declared here
Nevermind, I've looked inside and seen the use of buildtags, so while the README mentions linux I get that the "keychain" package is macos-only.