varun2784 / weed-fs

Automatically exported from code.google.com/p/weed-fs
0 stars 0 forks source link

compile error #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
# github.com/goraft/raft/protobuf
../../../../../github.com/goraft/raft/protobuf/append_entries_request.pb.go:113:
 undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_request.pb.go:130:
 undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_request.pb.go:147:
 undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_request.pb.go:164:
 undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_request.pb.go:181:
 undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_request.pb.go:204:
 undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_responses.pb.go:97
: undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_responses.pb.go:11
4: undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_responses.pb.go:13
1: undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_responses.pb.go:14
8: undefined: proto.ErrWrongType
../../../../../github.com/goraft/raft/protobuf/append_entries_responses.pb.go:14
8: too many errors

on go1.3

Original issue reported on code.google.com by better0...@gmail.com on 16 Aug 2014 at 2:10

GoogleCodeExporter commented 8 years ago
Need to wait for upstream goraft to make the change.

Original comment by chris...@gmail.com on 16 Aug 2014 at 11:54

GoogleCodeExporter commented 8 years ago
I get this error while compiling, it is caused by a error of upstream goraft 
that referencing a old version of gogoprotobuf, which removed the 
proto.ErrWrongType recently.
I found two ways to fix this issue, I'd like to share with others who suffering 
with it:

1. , there's another project has fixed called influxdb 
(https://github.com/influxdb/influxdb), we can replace the raft of reference in 
files below:

weed-fs/go/topology/cluster_commands.go
weed-fs/go/topology/topology.go
weed-fs/go/weed/weed_server/raft_server_handlers.go
weed-fs/go/weed/weed_server/raft_server.go
weed-fs/go/weed/weed_server/master_server.go

replacing "github.com/goraft/raft" to 
"github.com/influxdb/influxdb/_vendor/raft".
Now you can complie weed as normal.

2. Regenerate pb code files with the new gogoprotobuf. This issue is just a 
version problem, not a coding error, and this is recommended way. By steps like 
below:
cd into protobuf dir of goraft.
run command: protoc --go_out=. -I. -I$GOPATH -Iusr/include *.proto

Now new *.pb.go files have generated, you can compile weed as normal.

Wish to help others.

Original comment by leodas...@gmail.com on 23 Aug 2014 at 3:33

GoogleCodeExporter commented 8 years ago
This issue has been already fixed in upstream goraft.

Original comment by claudiu....@gmail.com on 24 Aug 2014 at 9:46

GoogleCodeExporter commented 8 years ago

Original comment by chris...@gmail.com on 24 Aug 2014 at 6:47