term icon indicating copy to clipboard operation
term copied to clipboard

undefined: open_pty_master Ptsname grantpt unlockpt

Open CodyGuo opened this issue 7 years ago • 9 comments

github.com/pkg/term/termios

..............\pkg\term\termios\pty.go:20:14: undefined: open_pty_master ..............\pkg\term\termios\pty.go:25:16: undefined: Ptsname ..............\pkg\term\termios\pty.go:30:8: undefined: grantpt ..............\pkg\term\termios\pty.go:35:8: undefined: unlockpt

CodyGuo avatar Feb 05 '18 07:02 CodyGuo

Hi. You’ve given me no information about how I can help you solve your problem.

Which version of Go? Which operating system? What commands did you type, show all of them, what happened when you typed them, show as much as you can.

On 5 Feb 2018, at 18:48, CodyGuo [email protected] wrote:

github.com/pkg/term/termios

..............\pkg\term\termios\pty.go:20:14: undefined: open_pty_master ..............\pkg\term\termios\pty.go:25:16: undefined: Ptsname ..............\pkg\term\termios\pty.go:30:8: undefined: grantpt ..............\pkg\term\termios\pty.go:35:8: undefined: unlockpt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

davecheney avatar Feb 05 '18 09:02 davecheney

This is seen when cross building for Solaris, or when building on Windows. I'll be following up with some fixes.

gdamore avatar Jun 25 '19 05:06 gdamore

thanks

CodyGuo avatar Jul 08 '19 02:07 CodyGuo

I get these issues when building with GOOS=openbsd using go version go1.15.5 linux/amd64 on Arch Linux:

# github.com/pkg/term/termios
vendor/github.com/pkg/term/termios/pty.go:22:14: undefined: open_pty_master
vendor/github.com/pkg/term/termios/pty.go:27:16: undefined: Ptsname
vendor/github.com/pkg/term/termios/pty.go:32:8: undefined: grantpt
vendor/github.com/pkg/term/termios/pty.go:37:8: undefined: unlockpt

The results are the same for:

  • Latest master, d02e49dd31404f3c3cf4b5469b28942194e0ca23
  • An earlier commit that works with FreeBSD, but not with OpenBSD: c3ffed290a03

xyproto avatar Nov 23 '20 18:11 xyproto

I tried to add some CI around this and from what I can tell, because the openbsd bindings use CGO it is difficult to cross compile them. I think this is the same problem that solaris faces.

davecheney avatar Dec 25 '20 02:12 davecheney

Experienced the same issue now. I transpiled a C file with c4go, which uses your package. Using Windows 10 (20H2) AMD64, Go 1.15.2, building with Goland 2020.3.

Attaching the go-file I'm trying to run. main.zip

kylhuk avatar Dec 28 '20 15:12 kylhuk

Thanks for the detail. I don’t know how to fix this as cross compiling cgo code is fraught with difficulty

davecheney avatar Dec 28 '20 19:12 davecheney

Sorry I never followed up -- I think at some point I assumed @davecheney wasn't interested in contributions to this package, as of the two PRs I submitted to it, one took over a year to get merged (with no feedback in the interim) and the other is still outstanding (though it now had conflicts). I can try to resurrect my work (I wound up going a totally different to not depend on this package) if there is interest, but I don't want to invest the time to put together a fix if its just going to bitrot indefinitely.

gdamore avatar Dec 28 '20 20:12 gdamore

@gdamore i sent you an invite to this repo so I won’t be a blocker any more

davecheney avatar Dec 28 '20 21:12 davecheney