sanbornm / go-selfupdate

Enable your Go applications to self update
MIT License
1.53k stars 176 forks source link

ARM Build Output #5

Closed gibsonsyd closed 9 years ago

gibsonsyd commented 9 years ago

Hi

I'm including the update feature in a golang app targeted for ARM. I'm cross compiling from the latest stable Ubuntu.

When I run: go-selfupdate {appname} {version} -platform="linux-arm"

The output .json file in public is "linux-amd64.json" should this not be "linux-arm.json"?

Am I setting an incorrect flag?

gibsonsyd commented 9 years ago

Just to suppliment my question here is my build env:

$ go env

GOARCH="arm" GOBIN="" GOCHAR="5" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/tmp/golang" GORACE="" GOROOT="/usr/lib/go" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" TERM="dumb" CC="gcc" GOGCCFLAGS="-g -O2 -fPIC -marm" CXX="g++" CGO_ENABLED="0"

As you can see both GOARCH and GOOS are set properly.

sanbornm commented 9 years ago

Hmm, that is odd. What happens if you omit the -platform flag? It should use GOARCH and GOOS if they are both set.

gibsonsyd commented 9 years ago

It does the same.

I ended up hard coding linux-arm instead of reading it from $GOARCH and $GOOS. Recompiled and tested, it works perfectly.

Thanks

On Tue, Mar 17, 2015 at 2:23 AM, Mark notifications@github.com wrote:

Hmm, that is odd. What happens if you omit the -platform flag? It should use GOARCH and GOOS if they are both set.

— Reply to this email directly or view it on GitHub https://github.com/sanbornm/go-selfupdate/issues/5#issuecomment-82003848 .