Summary
./install.sh fails on Linux during the "Installing cavekit command..." step because internal/tmux/terminal.go uses BSD/Darwin-only termios ioctl constants with no build tag.
Environment
- OS: Linux (amd64)
- Go: 1.26.2
golang.org/x/sys: v0.30.0
Error
# github.com/JuliusBrussee/cavekit/internal/tmux
internal/tmux/terminal.go:11:53: undefined: unix.TIOCGETA
internal/tmux/terminal.go:27:47: undefined: unix.TIOCSETA
internal/tmux/terminal.go:37:38: undefined: unix.TIOCSETA
Root cause
unix.TIOCGETA / unix.TIOCSETA are only defined in golang.org/x/sys/unix for Darwin and the BSDs. On Linux the equivalents are unix.TCGETS / unix.TCSETS (different ioctl numbers on Linux/glibc).
internal/tmux/terminal.go has no //go:build constraint, so Go compiles it on every Unix and the build breaks on Linux. Looks like it was written/tested on macOS only.
Suggested fixes
- Replace
TIOCGETA/TIOCSETA with TCGETS/TCSETS — works on both Linux and Darwin (Darwin defines both).
- Or split into
terminal_darwin.go / terminal_linux.go with //go:build tags.
- Simplest: use
golang.org/x/term's MakeRaw / Restore, which already handles per-OS ioctl names.
Adding a Linux job to CI would catch this class of regression.
Summary
./install.shfails on Linux during the "Installing cavekit command..." step becauseinternal/tmux/terminal.gouses BSD/Darwin-only termios ioctl constants with no build tag.Environment
golang.org/x/sys: v0.30.0Error
Root cause
unix.TIOCGETA/unix.TIOCSETAare only defined ingolang.org/x/sys/unixfor Darwin and the BSDs. On Linux the equivalents areunix.TCGETS/unix.TCSETS(different ioctl numbers on Linux/glibc).internal/tmux/terminal.gohas no//go:buildconstraint, so Go compiles it on every Unix and the build breaks on Linux. Looks like it was written/tested on macOS only.Suggested fixes
TIOCGETA/TIOCSETAwithTCGETS/TCSETS— works on both Linux and Darwin (Darwin defines both).terminal_darwin.go/terminal_linux.gowith//go:buildtags.golang.org/x/term'sMakeRaw/Restore, which already handles per-OS ioctl names.Adding a Linux job to CI would catch this class of regression.