go: x/crypto/ssh/terminal: build failing on darwin/amd64: undefined: unix.IoctlGetTermios

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/usr/local/goland"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y2/dnhd02vs2k3bmty6w3f0j7940000gn/T/go-build493794240=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

go get -u golang.org/x/crypto/ssh/terminal

What did you expect to see?

no error. The package should be fetched and built.

What did you see instead?

../../../../golang.org/x/crypto/ssh/terminal/util.go:30:12: undefined: unix.IoctlGetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:38:18: undefined: unix.IoctlGetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:54:12: undefined: unix.IoctlSetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:64:18: undefined: unix.IoctlGetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:75:9: undefined: unix.IoctlSetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:80:13: undefined: unix.IoctlGetWinsize
../../../../golang.org/x/crypto/ssh/terminal/util.go:98:18: undefined: unix.IoctlGetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:107:12: undefined: unix.IoctlSetTermios
../../../../golang.org/x/crypto/ssh/terminal/util.go:112:3: undefined: unix.IoctlSetTermios

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 9
  • Comments: 19 (11 by maintainers)

Most upvoted comments

@sapiens-sapide as @mvdan mentioned, did you check that your x/sys/unix clone wasn’t on a branch or some other detached git state? Did you get an error, e.g. like the following while doing go get -u golang.org/x/sys/unix:

# cd /Users/tklauser/go/src/golang.org/x/sys; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/sys/unix: exit status 1

Could you check the result of running git symbolic-ref HEAD in $GOPATH/src/golang.org/x/sys? If this doesn’t return refs/heads/master make sure to git checkout master and then try go get -u golang.org/x/crypto/ssh/terminal again?

Happens to my CI as well with a fresh context, in an alpine Docker image.

It downloads all vendors from scratch everytime using glide, and yet it always gives me the same errors as the other people here:

Step 6/12 : RUN go build -o cameradar
 ---> Running in 4d75c30fe5bc
# github.com/EtixLabs/cameradar/vendor/golang.org/x/crypto/ssh/terminal
../vendor/golang.org/x/crypto/ssh/terminal/util.go:30:12: undefined: unix.IoctlGetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:38:18: undefined: unix.IoctlGetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:54:12: undefined: unix.IoctlSetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:64:18: undefined: unix.IoctlGetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:75:9: undefined: unix.IoctlSetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:80:13: undefined: unix.IoctlGetWinsize
../vendor/golang.org/x/crypto/ssh/terminal/util.go:98:18: undefined: unix.IoctlGetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:107:12: undefined: unix.IoctlSetTermios
../vendor/golang.org/x/crypto/ssh/terminal/util.go:112:3: undefined: unix.IoctlSetTermios
The command '/bin/sh -c go build -o cameradar' returned a non-zero code: 2

See https://travis-ci.org/EtixLabs/cameradar/builds/310140604 for full build logs.

The version of golang.org/x/crypto that it uses is the commit 2509b142fb2b797aa7587dad548f113b2c0f20ce.

Cannot reproduce on neither Darwin not Linux with GOOS=darwin.

@sapiens-sapide Could you try to go get -u golang.org/x/sys/unix and then go get -u golang.org/x/crypto/ssh/terminalagain?