golang on amazon linux OS

1,721 views
Skip to first unread message

gra...@gmail.com

unread,
Dec 20, 2013, 10:48:55 AM12/20/13
to golan...@googlegroups.com
I have a quick noobie question.  I'm in devops engineer and I have a developer who has a go project that I'm trying to compile.

I downloaded the go binares on my mac OS and I was able to compile his project successfully. Good.

I compiled "go" myself on an AWS Amazon OS and I was able to compile his project successfully on an AWS Amazon OS with the go binaries that I compiled.  Good.

So far so good, but I figure I don't have to compile "go" unless I absolutely have to, so I tried:

"yum install golang" on an Amazon OS and tried to compile his project and this is the error that I got:

bash-4.1$ make
go install auth-api
# auth-api/dal

src/auth-api/dal/redis_token_provider.go:5: import /var/build/workspace/build-auth-api/pkg/linux_amd64/third_party/garyburd/redigo/redis.a: object is [linux amd64 go1.2 X:none] expected [linux amd64 go1.1.2 X:none]

Does this mean that the golang package that is being installed (version 1.1.2) is not compatible on this OS?
Notice the version mismatch:
object is  [linux amd64 go1.2 X:none]
expected [linux amd64 go1.1.2 X:none]

Thanks for the insight.  The workaround is easy enough for me to do (use the go binaries that I'm compiling), but I'm just curious about this error.

Thanks!

Ian Lance Taylor

unread,
Dec 20, 2013, 9:06:15 PM12/20/13
to gra...@gmail.com, golang-nuts
On Fri, Dec 20, 2013 at 7:48 AM, <gra...@gmail.com> wrote:
>
> src/auth-api/dal/redis_token_provider.go:5: import
> /var/build/workspace/build-auth-api/pkg/linux_amd64/third_party/garyburd/redigo/redis.a:
> object is [linux amd64 go1.2 X:none] expected [linux amd64 go1.1.2 X:none]

This error message means that you are trying to use a Go 1.1.2
compiler to import a package compiled by Go 1.2. The answer is to
build everything with th same compiler.

Ian

Alexander Gray II

unread,
Dec 20, 2013, 9:20:04 PM12/20/13
to Ian Lance Taylor, golang-nuts
OK. Just making sure.  I ended up using a yum mirror that has Go 1.2 and all is well now.
Likewise, I could have used the Go binaries that I originally built, but why build it if someone else has :)
Thanks!
--
-Alex-

Tamás Gulácsi

unread,
Dec 21, 2013, 12:30:05 AM12/21/13
to golan...@googlegroups.com
rm -r $GOPATH/pkg
Before using an earlier compiler.

C Banning

unread,
Dec 21, 2013, 6:46:14 AM12/21/13
to golan...@googlegroups.com, gra...@gmail.com
If it's pure go code why not just sent GOOS=linux and GOARCH=amd64 on the Mac OS X system and cross-compile the application.  You can test the deployment package on an in-house Linux install then upload to AWS.  (That's what I've been doing for the past 3 years, and I've had no problems.)
Reply all
Reply to author
Forward
0 new messages