google / goterm Goto Github PK
View Code? Open in Web Editor NEWGo Terminal library with PTY support and colors
License: BSD 3-Clause "New" or "Revised" License
Go Terminal library with PTY support and colors
License: BSD 3-Clause "New" or "Revised" License
When building goterm for ppc64le and s390x on Linux, the OpenPTY calls fail:
github.com/google/goterm/term
--- FAIL: TestClose (0.00s)
termios_test.go:92: OpenPTY failed: open /dev/pts/4294967296: no such file or directory
--- FAIL: TestGetPass (0.00s)
termios_test.go:138: OpenPTY() failed: open /dev/pts/4294967296: no such file or directory
--- FAIL: TestGetChar (0.00s)
termios_test.go:199: OpenPTY failed: open /dev/pts/4294967296: no such file or directory
FAIL
exit status 1
FAIL github.com/google/goterm/term 0.057s
You can find the full logs at https://koji.fedoraproject.org/koji/taskinfo?taskID=70436491 and https://koji.fedoraproject.org/koji/taskinfo?taskID=70436492 (look at build.log)
Hi.
I think I found a bug.
$ go build -i -v -x
WORK=/tmp/go-build100086455
github.com/pkg/term/termios
mkdir -p $WORK/b014/
cd $WORK
/home/oceanfish81/gollvm_dist/bin/llvm-goc -fgo-importcfg=/dev/null -c -x c - -o /dev/null || true
cd /home/oceanfis81/go/pkg/mod/github.com/pkg/[email protected]/termios
/home/oceanfish81/gollvm_dist/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=github.com/pkg/term/termios -o $WORK/b014/go.o -I $WORK/b014/importcfgroot ./doc.go ./ioctl.go ./pty.go ./pty_linux.go ./termios.go ./termios_const.go ./termios_linux.gogithub.com/pkg/term/termios
../../../go/pkg/mod/github.com/pkg/[email protected]/termios/pty_linux.go:15:27: error: reference to undefined identifier 'syscall.TIOCGPTN'
../../../go/pkg/mod/github.com/pkg/[email protected]/termios/pty_linux.go:24:27: error: reference to undefined identifier 'syscall.TIOCGPTN'
../../../go/pkg/mod/github.com/pkg/[email protected]/termios/pty_linux.go:29:27: error: reference to undefined identifier 'syscall.TIOCSPTLCK'
Here is my environment:
$ go env && go version
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oceanfis81/.cache/go-build"
GOENV="/home/oceanfis81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfis81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfis81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/oceanfish81/gollvm_dist"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/oceanfish81/gollvm_dist/tools"
GCCGO="/home/oceanfish81/gollvm_dist/bin/llvm-goc"
AR="ar"
CC="/usr/bin/clang"
CXX="/usr/bin/clang++"
CGO_ENABLED="1"
GOMOD="/home/oceanfis81/go_projects/c4go/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build402447636=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
go version go1.15.2 gollvm LLVM 12.0.0git linux/amd64
I am using gollvm - my "release" build could be found here
CC @thanm @cherrymui
I'm sure this worked at some stage ...
--- FAIL: ExampleColor (0.00s)
got:
Hello Green world
Warning!
Green world
Defcon: 2 FAST PACE
want:
Hello [32mGreen world[39m
[31mWarning![39m
[5mGreen world[0m
Defcon: [31m2 FAST PACE[39m
FAIL
exit status 1
FAIL github.com/google/goterm/term 0.067s
D:\01work\internal_software\trunk\devLicense\wlic\client>go version
go version go1.17 windows/amd64
D:\01work\internal_software\trunk\devLicense\wlic\client>go build
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:202:32: not enough arguments in call to syscall.Syscall
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:202:33: undefined: syscall.SYS_IOCTL
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:213:32: not enough arguments in call to syscall.Syscall
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:213:33: undefined: syscall.SYS_IOCTL
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:288:32: not enough arguments in call to syscall.Syscall
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:288:33: undefined: syscall.SYS_IOCTL
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:310:32: not enough arguments in call to syscall.Syscall
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:310:33: undefined: syscall.SYS_IOCTL
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:319:32: not enough arguments in call to syscall.Syscall
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:319:33: undefined: syscall.SYS_IOCTL
C:\Users\yxhlc\go\pkg\mod\github.com\google\[email protected]\term\termios.go:319:32: too many errors
D:\01work\internal_software\trunk\devLicense\wlic\client>
I have a variation on OpenPTY that is Darwin specific. It even works for both Sierra and High Sierra. For my own use, I can live with the goterm project being in a vendor directory and using it on Linux, Darwin and soon OpenBSD platforms. But the work to support Darwin was non-trivial and I'd like to share it but I don't see how without cloning the entire goterm repo. But cloning goterm means projects like goexpect wouldn't get the new options without also having been cloned for a one line import change.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.