opsgenie / opsgenie-lamp

OpsGenie Lamp with Go SDK
Apache License 2.0
34 stars 18 forks source link

Completely unable to use lamp on MacOS #19

Closed aSapien closed 4 years ago

aSapien commented 4 years ago

go version: go1.13.4 darwin/amd64 macos version: 10.15.1

Attempts to use the compiled binary from opsgenie-integration/opsgenie-lamp/opsgenie-lamp.zip result in the following error:

Failed to execute process './opsgenie-lamp'. Reason:
exec: Bad CPU type in executable

Attempts to go get ... result in the following errors:

go get github.com/opsgenie/opsgenie-lamp/...
# github.com/opsgenie/opsgenie-lamp
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:17:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
    cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:21: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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:25: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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:29: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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:37:18: 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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:41:18: 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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:45:18: 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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:49:18: 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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:53:18: 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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:57:18: 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)
../go/src/github.com/opsgenie/opsgenie-lamp/lamp.go:57:18: too many errors
curiositycasualty commented 4 years ago

To get this building on Mac OS versions that don't support x86 (32-bit) executables, which are "Catalina", 10.15+, I had to do the following.

Install go, and "dep" (dependancies manager for go):

brew install go dep

Set "GOPATH"s and friends:

export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"

Fetch the lamp source:

go get github.com/opsgenie/opsgenie-lamp

Change to the go-supplied source:

cd $HOME/golang/src/github.com/opsgenie/opsgenie-lamp

Use dep to fetch the dependancies at the versions specified in Gopkg.toml:

dep ensure

And finally run go build with the proper architecture:

export GOOS=darwin GOARCH=amd64; go build

You'll be supplied with an "opsgenie-lamp" in the current directory which you can copy elsewhere. I keep mine in a homebrew-ish location:

cp opsgenie-lamp /usr/local/bin/
curiositycasualty commented 4 years ago

Ideally the Opsgenie supplied binary would be 64-bit.

metehanozturk commented 4 years ago

The binary file is refreshed to 64-bit for macOS.

tmack8001 commented 4 years ago

I had to so the same as @curiositycasualty to get this working on my macOS running Mojave 10.14.6

cemkucuk commented 4 years ago

Hi @tmack8001, did you try latest package from here? https://github.com/opsgenie/opsgenie-integration/blob/master/opsgenie-lamp/opsgenie-lamp.zip

It's working for me on 10.14.6

tmack8001 commented 4 years ago

No I installed opsgenie-lamp with go get and got version 3.0.0

lamp --version
lamp version 3.0.0
adzuci commented 4 years ago

This seems to still be an issue for me on Mojave 10.14.6 when running:

go get github.com/opsgenie/opsgenie-lamp

However

wget https://github.com/opsgenie/opsgenie-integration/raw/master/opsgenie-lamp/opsgenie-lamp.zip && unzip opsgenie-lamp.zip && chmod +x opsgenie-lamp && rm -rf opsgenie-lamp.zip

works.