----- Forwarded message from Kian Ali Agheli <k...@disroot.org> -----
Date: Sun, 7 Jul 2024 21:08:11 -0700 From: Kian Ali Agheli <k...@disroot.org> To: Qingyao Sun <sunqingyao19970...@icloud.com> Subject: Re: Pre-compiled static go binary fails with "undefined symbol 'syscall'" OpenBSD recently changed access to its syscalls. The change which allows upstream Go to build working executables for current OpenBSD was committed on May 4th. https://github.com/golang/go/commit/8841f50d98b224ecf5ee27d9b7e6f18ad2c98e46 The kitty binary was built by Go version 1.22.4. $ strings kitten-openbsd-amd64 | grep go1 ... go1.22.4 Go 1.22.4 was released June 4th. https://go.dev/doc/devel/release#go1.22.0 It isn't an issue with the Go version used to compile. The change was upstreamed two months ago, and the Go version used was released one month ago. It's an issue with kitty itself. $ git clone https://github.com/kovidgoyal/kitty . $ grep -r syscall * ... kittens/transfer/receive.go:func syscall_mode(i os.FileMode) (o uint32) { kittens/transfer/receive.go: if err := unix.Fchmodat(unix.AT_FDCWD, self.expanded_local_path, syscall_mode(self.permissions), unix.AT_SYMLINK_NOFOLLOW); err == nil || !(errors.Is(err, unix.EINTR) || errors.Is(err, unix.EAGAIN)) { kittens/transfer/send.go: "syscall" kittens/transfer/send.go: stat, ok := stat_result.Sys().(*syscall.Stat_t) kittens/transfer/send.go: stat, ok := st.Sys().(*syscall.Stat_t) ... Kitty uses syscalls in a way which OpenBSD no longer supports. Send the maintainer of Kitty to look at this code: https://github.com/golang/go/blob/master/src/syscall/syscall_openbsd_libc.go#L19 If they're willing to do the work, they'll have enough information to figure out how to fix the software. On Sun, Jul 07, 2024 at 04:58:47PM -0400, Qingyao Sun wrote: > Description: > I am using the kitty terminal (https://github.com/kovidgoyal/kitty) > with OpenBSD as an SSH host. > As part of the shell integration, kitty needs to download a > pre-compiled static go binary onto > the host, e.g. > https://github.com/kovidgoyal/kitty/releases/download/v0.35.2/kitten-openbsd-amd64. > The problem is that this binary aborts with an error when I tried to > execute it. > > I have reported this issue to the kitty maintainer on GitHub. See the > following comment: > > https://github.com/kovidgoyal/kitty/issues/7602#issuecomment-2212326911. > However, his reply is > > Then that would be a bug in Go's stdlib on OpenBSD. Sadly I know > nothing > > about OpenBSD, so I cant help you with that. From the error message > > OpenBSD's libc is apparently missing syscall. ----- End forwarded message -----