pkg/term

termios does not build on Illumos/OpenIndiana

grueni opened this issue · 1 comments

I try to build gitlab-runner in OpenIndiana. pkg/term included in gitlab-runner is too old and compilation failed.
I managed to replace the vendored x/sys/unix and pkg/term.
But now compilation fails with "...undefined: open_pty_master".
The function is available in pty_solaris.go but the file is not used when built.
When I change to the directory of termios and check which files will be built, I get
../termios# go list -f '{{.GoFiles}}'
[doc.go ioctl_solaris.go pty.go termios.go]
When I edit pty_solaris.go and comment out 'import "C"' pty_solaris.go is found by go list
../termios# go list -f '{{.GoFiles}}'
[doc.go ioctl_solaris.go pty.go pty_solaris.go termios.go]

Is this a problem of using cgo and conditional compilation?
Unfortunately I am a complete newbie concerning go and I have no clue what to do.

Similar problems
http://muscles.dragonflybsd.org/synth/logs/net___concourse-fly.log
fiam/idf_wmonitor#1
#27

/termios# go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="solaris"
GOOS="solaris"
GOPATH="/export/builds/oi-userland/components/sysutils/gitlab-runner/build/amd64/.gopath"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang/1.11"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/1.11/pkg/tool/solaris_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build206860015=/tmp/go-build -gno-record-gcc-switches"

gitlab-runner disables CGO by default.
For Solaris CGO_ENABLED=1 must be used as build argument.