DarthSim / hivemind

Process manager for Procfile-based applications
MIT License
1k stars 30 forks source link

Installation via `go get` as documented in README fails #16

Closed turtlemonvh closed 4 years ago

turtlemonvh commented 4 years ago

With go 1.13 on Centos 7

[vagrant@localhost ~]$ go version
go version go1.13.6 linux/amd64
[vagrant@localhost ~]$ go get -u -f github.com/DarthSim/hivemind
# github.com/DarthSim/hivemind
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:26:5: app.Author undefined (type *cli.App has no field or method Author)
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:27:5: app.Email undefined (type *cli.App has no field or method Email)
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:33:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
        cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:33:36: unknown field 'EnvVar' in struct literal of type cli.StringFlag
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:34:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
        cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:34:40: unknown field 'EnvVar' in struct literal of type cli.StringFlag
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:35:14: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in array or slice literal:
        cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:35:32: unknown field 'EnvVar' in struct literal of type cli.IntFlag
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:36:14: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in array or slice literal:
        cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:36:37: unknown field 'EnvVar' in struct literal of type cli.IntFlag
/opt/gopath/src/github.com/DarthSim/hivemind/main.go:36:14: too many errors
[vagrant@localhost ~]$ ( cd /opt/gopath/src/github.com/DarthSim/hivemind/ && git status -v && git log | head -n5 )
# On branch master
nothing to commit, working directory clean
commit 10d1fa0ff72d08fd1110f2c17a5bc0b1714af4af
Author: DarthSim <darthsim@gmail.com>
Date:   Wed Dec 18 16:59:01 2019 +0600

    Update readme

With go 1.12 on osx

is-mbp-timothy4:tmp timothy$ go version
go version go1.12.1 darwin/amd64
is-mbp-timothy4:tmp timothy$ go get -u -f github.com/DarthSim/hivemind
# github.com/DarthSim/hivemind
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:26:5: app.Author undefined (type *cli.App has no field or method Author)
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:27:5: app.Email undefined (type *cli.App has no field or method Email)
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:33:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
    cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:33:36: unknown field 'EnvVar' in struct literal of type cli.StringFlag
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:34:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
    cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:34:40: unknown field 'EnvVar' in struct literal of type cli.StringFlag
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:35:14: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in array or slice literal:
    cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:35:32: unknown field 'EnvVar' in struct literal of type cli.IntFlag
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:36:14: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in array or slice literal:
    cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:36:37: unknown field 'EnvVar' in struct literal of type cli.IntFlag
/Users/timothy/go/src/github.com/DarthSim/hivemind/main.go:36:14: too many errors
is-mbp-timothy4:tmp timothy$ ( cd /Users/timothy/go/src/github.com/DarthSim/hivemind/ && git status -v && git log | head -n5 )
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
commit 10d1fa0ff72d08fd1110f2c17a5bc0b1714af4af
Author: DarthSim <darthsim@gmail.com>
Date:   Wed Dec 18 16:59:01 2019 +0600

    Update readme
turtlemonvh commented 4 years ago

I see similar issues when using lines from the build-all.sh script

is-mbp-timothy4:tmp timothy$ cd /Users/timothy/go/src/github.com/DarthSim/hivemind/
is-mbp-timothy4:hivemind timothy$ version=$(/bin/sh -c 'git describe --always --tags --abbrev=0')
is-mbp-timothy4:hivemind timothy$ echo $version
v1.0.6
is-mbp-timothy4:hivemind timothy$ env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=$version" -a -installsuffix cgo -o dist/hivemind .

# github.com/DarthSim/hivemind
./main.go:26:5: app.Author undefined (type *cli.App has no field or method Author)
./main.go:27:5: app.Email undefined (type *cli.App has no field or method Email)
./main.go:33:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
    cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:33:36: unknown field 'EnvVar' in struct literal of type cli.StringFlag
./main.go:34:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
    cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:34:40: unknown field 'EnvVar' in struct literal of type cli.StringFlag
./main.go:35:14: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in array or slice literal:
    cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:35:32: unknown field 'EnvVar' in struct literal of type cli.IntFlag
./main.go:36:14: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in array or slice literal:
    cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:36:37: unknown field 'EnvVar' in struct literal of type cli.IntFlag
./main.go:36:14: too many errors
turtlemonvh commented 4 years ago

It looks like this is because of the cli lib and version locking.

Since the application requires specific versions of deps to work, it may be best to remove the lines about being able to build with go get from the README.

Could also be fixed by following suggestions in https://github.com/DarthSim/hivemind/issues/2 to document vendoring workflow.

turtlemonvh commented 4 years ago

FYI I downloaded the latest binary release and that does work fine, so this certainly looks to be just a build issue. :)

DarthSim commented 4 years ago

Does GO111MODULE=on go get -u github.com/DarthSim/hivemind work for you?

turtlemonvh commented 4 years ago

Thanks for checking in on this.

Using GO111MODULE=on gets further on mac.

is-mbp-timothy4:tmp timothy$ cd $GOPATH
is-mbp-timothy4:go timothy$ GO111MODULE=on go get -u github.com/DarthSim/hivemind
go: finding github.com/DarthSim/hivemind v1.0.6
go: downloading github.com/DarthSim/hivemind v1.0.6
go: extracting github.com/DarthSim/hivemind v1.0.6
go: finding github.com/pkg/term/termios latest
go: finding github.com/joho/godotenv/autoload latest
go: finding github.com/joho/godotenv v1.3.0
go: finding github.com/pkg/term latest
go: downloading github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942
go: finding gopkg.in/urfave/cli.v1 v1.22.2
go: downloading github.com/joho/godotenv v1.3.0
go: extracting github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942
go: extracting github.com/joho/godotenv v1.3.0
go: downloading gopkg.in/urfave/cli.v1 v1.22.2
build github.com/DarthSim/hivemind: cannot load gopkg.in/urfave/cli.v1: cannot find module providing package gopkg.in/urfave/cli.v1

This is what the pkg dir looks like, if that helps.

is-mbp-timothy4:go timothy$ tree -L 2 pkg/mod/github.com/
pkg/mod/github.com/
├── !darth!sim
│   └── hivemind@v1.0.6
├── joho
│   └── godotenv@v1.3.0
├── karrick
│   └── godirwalk@v1.12.0
├── keegancsmith
│   └── rpc@v1.1.0
├── mdempsky
│   └── gocode@v0.0.0-20190203001940-7fb65232883f
├── pkg
│   ├── errors@v0.8.1
│   └── term@v0.0.0-20190109203006-aa71e9d9e942
├── ramya-rao-a
│   └── go-outline@v0.0.0-20181122025142-7182a932836a
├── rogpeppe
│   └── godef@v1.1.1
├── sqs
│   └── goreturns@v0.0.0-20181028201513-538ac6014518
├── stamblerre
│   └── gocode@v0.0.0-20190327203809-810592086997
└── uudashr
    └── gopkgs@v2.0.1+incompatible

23 directories, 0 files
DarthSim commented 4 years ago

Thanks! I updated the README