openflagr / flagr

Flagr is a feature flagging, A/B testing and dynamic configuration microservice
https://openflagr.github.io/flagr
Apache License 2.0
2.41k stars 183 forks source link

getting error when running make build #133

Closed amalfra closed 6 years ago

amalfra commented 6 years ago

After getting latest code(doing dep ensure, make deps etc) and running make gen, make build throws following error:

# github.com/checkr/flagr/swagger_gen/restapi
swagger_gen/restapi/server.go:174:18: cannot use domainSocket (type *graceful.Server) as type *http.Server in argument to configureServer
swagger_gen/restapi/server.go:206:18: cannot use httpServer (type *graceful.Server) as type *http.Server in argument to configureServer
swagger_gen/restapi/server.go:292:18: cannot use httpsServer (type *graceful.Server) as type *http.Server in argument to configureServer
make: *** [build] Error 2

Expected Behavior

Generated binary sucessfully

Current Behavior

Errors, can't compile

Possible Solution

Steps to Reproduce (for bugs)

  1. pull latest code
  2. do dep ensure
  3. do make deps
  4. do make gen
  5. do make build

Context

I am trying to add new query parameter for rest api but error prevents me from successfully compiling

Your Environment

zhouzhuojie commented 6 years ago

Yup, upstream go get -u github.com/go-swagger/go-swagger/cmd/swagger recently changed the generated server api (graceful.Server => http.Server).

Did you run make deps to get the latest version of the tools? I can't reproduce the bug. I did a sanity check from make all

zhouzhuojie commented 6 years ago

Related to https://github.com/go-swagger/go-swagger/pull/1574

amalfra commented 6 years ago

@zhouzhuojie thanks for replaying. I tried go get, make all, make deps etc. before doing make build. Still I get the error. I think my dependencies versions are messed up. Let me try if I can clean all vendor packages and see if it works

egbonrelu commented 6 years ago

I had the same error when I ran make build The OS version is

Ubuntu 16.04.4 LTS

Futhermore, on running make all, I had another error

sed: can't read : No such file or directory Makefile:87: recipe for target 'goqueryset' failed make: *** [goqueryset] Error 123

zhouzhuojie commented 6 years ago

Landed two prs, let me know if it works

amalfra commented 6 years ago

but now I get this package error when doing make all. do I need to run any other commands before that?(did try dep ensure but looks like missing package is still not there)

Check deps
Checking project is in GOPATH
Installing retool
retool: installing github.com/golang/dep/cmd/dep
retool: installing github.com/alecthomas/gometalinter
retool: installing github.com/go-swagger/go-swagger/cmd/swagger
retool: installing github.com/jirfag/go-queryset/cmd/goqueryset
retool: installing github.com/dave/courtney
retool: installing github.com/codeskyblue/fswatch
Installing:
  deadcode
  dupl
  errcheck
  gas
  gochecknoglobals
  gochecknoinits
  goconst
  gocyclo
  goimports
  golint
  gosimple
  gotype
  gotypex
  ineffassign
  interfacer
  lll
  maligned
  megacheck
  misspell
  nakedret
  safesql
  staticcheck
  structcheck
  unconvert
  unparam
  unused
  varcheck
can't load package: package 4d63.com/gochecknoglobals: cannot find package "4d63.com/gochecknoglobals" in any of:
    /Users/amal/.gvm/gos/go1.10/src/4d63.com/gochecknoglobals (from $GOROOT)
    /Users/amal/amal/src/github.com/alecthomas/gometalinter/_linters/src/4d63.com/gochecknoglobals (from $GOPATH)
can't load package: package 4d63.com/gochecknoinits: cannot find package "4d63.com/gochecknoinits" in any of:
    /Users/amal/.gvm/gos/go1.10/src/4d63.com/gochecknoinits (from $GOROOT)
    /Users/amal/amal/src/github.com/alecthomas/gometalinter/_linters/src/4d63.com/gochecknoinits (from $GOPATH)
WARNING: failed to install one or more linters: exit status 1 (installing individually)
can't load package: package 4d63.com/gochecknoglobals: cannot find package "4d63.com/gochecknoglobals" in any of:
    /Users/amal/.gvm/gos/go1.10/src/4d63.com/gochecknoglobals (from $GOROOT)
    /Users/amal/amal/src/github.com/alecthomas/gometalinter/_linters/src/4d63.com/gochecknoglobals (from $GOPATH)
WARNING: failed to install 4d63.com/gochecknoglobals: exit status 1
can't load package: package 4d63.com/gochecknoinits: cannot find package "4d63.com/gochecknoinits" in any of:
    /Users/amal/.gvm/gos/go1.10/src/4d63.com/gochecknoinits (from $GOROOT)
    /Users/amal/amal/src/github.com/alecthomas/gometalinter/_linters/src/4d63.com/gochecknoinits (from $GOPATH)
WARNING: failed to install 4d63.com/gochecknoinits: exit status 1
gometalinter: error: failed to install the following linters: 4d63.com/gochecknoglobals, 4d63.com/gochecknoinits
retool: fatal err: failed on 'gometalinter --install': exit status 1
make: *** [deps] Error 1
zhouzhuojie commented 6 years ago

Looks like related to gvm. If you don't need multiple versions of go, I think you can try with the native installed go. There are multiple tickets open related to their GOPATH settings.

https://github.com/moovweb/gvm/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

amalfra commented 6 years ago

okay, thanks. I will have a look. Will close this as original issue is fixed.