absmach / magistrala

Industrial IoT Messaging and Device Management Platform
https://www.abstractmachines.fr/magistrala.html
Apache License 2.0
2.48k stars 674 forks source link

Problem in build using Makefile #507

Closed 3a8r closed 5 years ago

3a8r commented 5 years ago

Hi, When I use Makefile in project root for make project, I face with these errors:

CGO_ENABLED=0 GOOS=linux GOARCH= GOARM= go build -ldflags "-s -w" -o build/mainflux-users cmd/users/main.go
command-line-arguments
cmd/users/main.go:139:31: cannot use "github.com/go-kit/kit/metrics/prometheus".NewCounterFrom("github.com/prometheus/client_golang/prometheus".CounterOpts literal, []string literal) (type *"github.com/go-kit/kit/metrics/prometheus".Counter) as type"github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics".Counter in argument to api.MetricsMiddleware:
        *"github.com/go-kit/kit/metrics/prometheus".Counter does not implement "github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics".Counter (wrong type for With method)
                have With(...string) "github.com/go-kit/kit/metrics".Counter
                want With(...string) "github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics".Counter
cmd/users/main.go:145:31: cannot use "github.com/go-kit/kit/metrics/prometheus".NewSummaryFrom("github.com/prometheus/client_golang/prometheus".SummaryOpts literal, []string literal) (type *"github.com/go-kit/kit/metrics/prometheus".Summary) as type"github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics".Histogram in argument to api.MetricsMiddleware:
        *"github.com/go-kit/kit/metrics/prometheus".Summary does not implement "github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics".Histogram (wrong type for With method)
                have With(...string) "github.com/go-kit/kit/metrics".Histogram
                want With(...string) "github.com/mainflux/mainflux/vendor/github.com/go-kit/kit/metrics".Histogram
cmd/users/main.go:187:37: cannot use server (type *"google.golang.org/grpc".Server) as type *"github.com/mainflux/mainflux/vendor/google.golang.org/grpc".Server in argument to mainflux.RegisterUsersServiceServer
Makefile:55: recipe for target 'users' failed
make: *** [users] Error 2

Do you have any idea to fix this?

drasko commented 5 years ago

@smesgary I do not see this problem:

drasko@Marx:~/go/src/github.com/mainflux/mainflux$ make users
CGO_ENABLED=0 GOOS=linux GOARCH= GOARM= go build -ldflags "-s -w" -o build/mainflux-users cmd/users/main.go

Did you change anything in the code?

Can you try cloning the fresh code, maybe you messed up something with branches locally?

Otherwise, here might be something missing in the vendor dir from our side, but I doubt it - as we have CI that constanstly builds and tests the master branch.

drasko commented 5 years ago

Closing this one. @smesgary please reopen if needed.