Skip to content

Support building on "darwin" with golang.org/x/sys updated over 6fcdbc0bbc04dcd9e7dc145879ceaf9bf1c6ff03 #15

@invidian

Description

@invidian

golang/sys@6fcdbc0 has removed some "darwin" related code, so projects, which use higher versions of golang.org/x/sys can no longer be built for this platform.

Example:

cat <<EOF > go.mod
module foo

go 1.15

require (
        github.com/moby/term v0.0.0-20200611042045-63b9a826fb74
        golang.org/x/sys v0.0.0-20200828080924-6fcdbc0bbc04 // indirect
)
EOF

cat <<EOF > main.go
package main

import (
        "log"
        "os"

        "github.com/moby/term"
)

func main() {
        fd := os.Stdin.Fd()
        if term.IsTerminal(fd) {
                ws, err := term.GetWinsize(fd)
                if err != nil {
                        log.Fatalf("term.GetWinsize: %s", err)
                }
                log.Printf("%d:%d\n", ws.Height, ws.Width)
        }
}
EOF

GOOS=darwin go build

Results in:

# github.com/moby/term
../../../go/pkg/mod/github.com/moby/term@v0.0.0-20200611042045-63b9a826fb74/tc.go:13:28: undefined: unix.SYS_IOCTL
../../../go/pkg/mod/github.com/moby/term@v0.0.0-20200611042045-63b9a826fb74/tc.go:18:28: undefined: unix.SYS_IOCTL
../../../go/pkg/mod/github.com/moby/term@v0.0.0-20200611042045-63b9a826fb74/termios_bsd.go:24:31: undefined: unix.SYS_IOCTL
../../../go/pkg/mod/github.com/moby/term@v0.0.0-20200611042045-63b9a826fb74/termios_bsd.go:37:31: undefined: unix.SYS_IOCT

Note: the same now happens for older versions of github.com/docker/docker or github.com/moby/moby, but the latest master already depends on this code here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions