Skip to content

Missing support for linux/ppc - please update vendored packages #3073

@bwh-mind

Description

@bwh-mind

docker-cli currently cannot be built for linux/ppc (which is supported by gccgo).

In order to support it, these vendored packages should be updated:

  • golang.org/x/sys (recently added linux/ppc support)
  • github.com/modern-go/reflect2 (one file now marked not to be build with gccgo)

I would make a pull request, but I don't understand quite how you handle updates of vendored packages.

The current version of reflect2 now requires Go 1.9. If that's a problem, you could instead update it to commit 7e6ae53ffa0b80243b941dafd23e2c78e2f24135.

After updating these, there are still a couple of symbols that are missing from gccgo's version of the syscalls package, but I will try to get that fixed there.

Steps to reproduce the issue:

  1. Try to build docker-cli using gccgo for linux/ppc:
$ GO111MODULE=off GOARCH=ppc GOROOT="" CC="powerpc-linux-gnu-gcc" CXX="powerpc-linux-gnu-g++" GCCGO="powerpc-linux-gnu-gccgo" GOBIN= CGO_ENABLED=1 GOPATH="$BUILD_DIR/gopath" go build  -v -compiler gccgo -gccgoflags='-s' -tags "autogen" -p 9 -o "$BUILD_DIR"/bin/docker ./cmd/docker

Describe the results you received:
Build quickly fails:

# github.com/docker/cli/vendor/golang.org/x/sys/unix
build/gopath/src/github.com/docker/cli/vendor/golang.org/x/sys/unix/affinity_linux.go:14:35: error: reference to undefined name ‘_NCPUBITS’
   14 | const cpuSetSize = _CPU_SETSIZE / _NCPUBITS
      |                                   ^
build/gopath/src/github.com/docker/cli/vendor/golang.org/x/sys/unix/affinity_linux.go:14:33: error: division by zero
   14 | const cpuSetSize = _CPU_SETSIZE / _NCPUBITS
      |                                 ^
...

Describe the results you expected:
Should build succesfully.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:
Not applicable as it didn't build. I used current master (commit 04dad42c3c82733c3c82b1f859829d62d8608128).

Output of docker info:
Not applicable as it didn't build.

Additional environment details (AWS, VirtualBox, physical, etc.):

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