Swarmkit: Swarmkit cannot be built with golang 1.6.3

Created on 10 Sep 2016  路  10Comments  路  Source: docker/swarmkit

Error

michel@homebox ~/go/src/github.com/docker/swarmkit $ make binaries
馃惓 bin/swarmd
# github.com/docker/swarmkit/vendor/github.com/docker/docker/client/transport
vendor/github.com/docker/docker/client/transport/tlsconfig_clone.go:10: c.Clone undefined (type *tls.Config has no field or method Clone)
# github.com/docker/swarmkit/api
api/dispatcher.pb.go:1574: p.cluster undefined (type *raftProxyDispatcherServer has no field or method cluster)
api/dispatcher.pb.go:1581: p.connSelector.Conn undefined (type raftselector.ConnProvider has no field or method Conn)
api/dispatcher.pb.go:1593: p.connSelector.Reset undefined (type raftselector.ConnProvider has no field or method Reset)
Makefile:89: recipe for target 'bin/swarmd' failed
make: *** [bin/swarmd] Error 2

Go Version

michel@homebox ~/go/src/github.com/docker/swarmkit $ go version
go version go1.6.3 linux/amd64

Most helpful comment

@xiaods

brew upgrade --devel protobuf
Actually, proto 3 is now stable so you don't need the development version anymore. brew upgrade protobuf (without --devel) should install 3.0.2 now.

@michelvocks

The second part was the protobuf which was still version 2.5. It might make sense to add this package to the build requirements list?

Yes it definitely makes sense - I think we shouldn't put OS specific details (e.g. brew install etc) but rather just say that it requires protobuf 3.x and link to the protobuf instructions.

All 10 comments

I believe this was recently fixed in the transport package, and revendoring it will fix compilation with Go 1.6.x.

@aaronlehmann i found there is bug. the vendor is not update for the fixed patch on upstream docker/docker

Clone bug is fixed with revendor the docker/docker/client/transport .
now here is another error:

# github.com/docker/swarmkit/api
api/dispatcher.pb.go:1574: p.cluster undefined (type *raftProxyDispatcherServer has no field or method cluster)
api/dispatcher.pb.go:1581: p.connSelector.Conn undefined (type raftselector.ConnProvider has no field or method Conn)
api/dispatcher.pb.go:1593: p.connSelector.Reset undefined (type raftselector.ConnProvider has no field or method Reset)
make: *** [bin/swarmd] Error 2

i guess the protobuf's version is not corrent. it should be 3.0

in macos, brew upgrade --devel protobuf to install 3.0 beta protobuf

Env: go 1.6.3

let me recap the actions to resolve the problem:

  1. revendor the transport package to swarmkit repo
gvt fetch github.com/docker/docker/client/transport  
  1. upgrade macos protobuf to 3.0
brew upgrade --devel protobuf 
  1. make generate to rebuild the proto file
make generate
  1. bingo!
make all

When https://github.com/docker/docker/pull/26436 is merged, we'll revendor the relevant packages and this should no longer be an issue.

cc @stevvooe

Thanks @aaronlehmann and @xiaods
The issue was split into two parts. The first part was the missing revendoring.
The second part was the protobuf which was still version 2.5. It might make sense to add this package to the build requirements list?

@xiaods

brew upgrade --devel protobuf
Actually, proto 3 is now stable so you don't need the development version anymore. brew upgrade protobuf (without --devel) should install 3.0.2 now.

@michelvocks

The second part was the protobuf which was still version 2.5. It might make sense to add this package to the build requirements list?

Yes it definitely makes sense - I think we shouldn't put OS specific details (e.g. brew install etc) but rather just say that it requires protobuf 3.x and link to the protobuf instructions.

Was this page helpful?
0 / 5 - 0 ratings