pkg / term

Package term manages POSIX terminals.
BSD 2-Clause "Simplified" License
393 stars 64 forks source link

termios does not build on solaris #40

Closed jperkin closed 5 years ago

jperkin commented 5 years ago

While building the latest release of influxdb, its term dependency causes the build to fail:

===> Building for influxdb-1.7.1
github.com/pkg/term/termios
# github.com/pkg/term/termios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/ioctl_solaris.go:6:38: cannot use int(request) (type int) as type uint in argument to unix.IoctlSetInt
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:34:25: cannot convert *termios (type unix.Termios) to type syscall.Termios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:40:42: cannot use int(action) (type int) as type uint in argument to unix.IoctlSetTermios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:40:67: cannot convert argp (type *syscall.Termios) to type *unix.Termios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:80:31: cannot convert attr (type *syscall.Termios) to type *unix.Termios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:86:31: cannot convert attr (type *syscall.Termios) to type *unix.Termios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:93:31: cannot convert attr (type *syscall.Termios) to type *unix.Termios
/home/pbulk/build/databases/influxdb/work/src/github.com/pkg/term/termios/termios_solaris.go:99:31: cannot convert attr (type *syscall.Termios) to type *unix.Termios
*** Error code 2

I was able to fix up the uint cases, though I don't understand why the second argument to ioctl is taking uint when the underlying system call takes int. I see in #38 there are other concerns regarding the syscall package that I'm wondering is the cause for the other failures that I don't know how to fix.

I tried with go 1.11.2 and 1.10.5, both fail in the same way.

jperkin commented 5 years ago

FWIW influxdb currently has a Gopkg.lock pkg/term dependency on revision bffc007b7fd5a70e20e28f5b7649bb84671ef436

AttilaFueloep commented 5 years ago

@jperkin I have a local patch for this issue and influxdb builds fine with the patched version on SmartOS/pkgsrc-trunk. I'm going to open a PR in the next couple of days, let's see how it goes.

To keep the changes small, I didn't touch the dependency on the deprecated syscall package. As to why the second argument is now a uint I can't say anything, sorry.