mweagle / Sparta

go microservices, powered by AWS Lambda
https://gosparta.io
MIT License
717 stars 48 forks source link

Doesn't work with Mac OSX #101

Closed telenieko closed 6 years ago

telenieko commented 6 years ago

Documentation does not state which platforms are supported for development, so one would guess any platform supported by golang is good but...

Following the getting started from Mac OS, when doing the go run main.go ...

INFO[0000] ../../github.com/mweagle/Sparta/sparta_main_awsbinary.go:17:2: cannot find package "github.com/zcalusic/sysinfo" in any of:

INFO[0000]  /Users/marc/.gvm/gos/go1.9/src/github.com/zcalusic/sysinfo (from $GOROOT)
INFO[0000]  /Users/marc/go/src/github.com/zcalusic/sysinfo (from $GOPATH)
INFO[0000] Invoking rollback functions

As far as I understand zcalusic/sysinfo is Linux only.

go version go1.9 darwin/amd64 GOARCH="amd64" GOBIN="/Users/marc/go/bin" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lc/80799yss6klb3_ft_szyfgyr0000gn/T/go-build360770781=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++"

mweagle commented 6 years ago

Hi @telenieko - fair assumption & I do develop on OSX. I suspect the build tags may be interfering with go gets ability to fetch the package. Will see if there's a workaround. In the meantime, if you execute:

go get github.com/zcalusic/sysinfo

directly are you able to build a Sparta app?

mweagle commented 6 years ago

Added a precondition check - will be available in 1.0.2:

...

ERRO[0000] Failed to validate preconditions: Please run `go get -u -v github.com/zcalusic/sysinfo` to install this Linux-only package. This package is used when cross-compiling your AWS Lambda binary and cannot be reliably imported across platforms
exit status 1
telenieko commented 6 years ago

@mweagle, yes the workaround works:

go get github.com/zcalusic/sysinfo
# github.com/zcalusic/sysinfo
../../github.com/zcalusic/sysinfo/kernel.go:24:12: undefined: syscall.Utsname
../../github.com/zcalusic/sysinfo/kernel.go:25:12: undefined: syscall.Uname
mweagle commented 6 years ago

Updated error text:

INFO[0000] main.go:7:2: cannot find package "github.com/zcalusic/sysinfo" in any of:
INFO[0000]  /Users/mweagle/Documents/go192/src/github.com/zcalusic/sysinfo (from $GOROOT)
INFO[0000]  /Users/mweagle/Documents/gopath/src/github.com/zcalusic/sysinfo (from $GOPATH)
ERRO[0000] The `github.com/zcalusic/sysinfo` package is not installed  gopath=/Users/mweagle/Documents/gopath os=darwin sysinfoMarkerPath=/Users/mweagle/Documents/gopath/src/github.com/zcalusic/sysinfo/sysinfo.go

...

ERRO[0000] Failed to validate preconditions: Please run `go get -u -v github.com/zcalusic/sysinfo` to install this Linux-only package. This package is used when cross-compiling your AWS Lambda binary and cannot be reliably imported across platforms. When you `go get` the package, you may see errors as in `undefined: syscall.Utsname`. These are expected and can be ignored
mweagle commented 6 years ago

Released with 1.1.0. Closing.