appengine: how to install a package using the included go distribution

595 views
Skip to first unread message

Alexandru Moșoi

unread,
Apr 4, 2012, 5:34:51 PM4/4/12
to golang-nuts
Hello,

I'm trying to install gorilla/sessions using a clean installation of
appengine. I managed to hack around missing executables before I got a
compilation error in the go source. Here is my command line history
(the commands should be self explanatory). FWIW, I'm using Debian on a
64 bit CPU.


$ export | grep "GO\\|PATH"
declare -x GOPATH="/home/alexandru/source/foobar/"
declare -x PATH="/home/alexandru/bin:/usr/local/bin:/usr/bin:/bin:/usr/
local/games:/usr/games:/home/alexandru/source/google_appengine/"

$ cd /home/alexandru/source/
$ unzip /home/alexandru/Downloads/
go_appengine_sdk_linux_amd64-1.6.4.zip
$ cd google_appengine/

$ go get code.google.com/p/gorilla/sessions
load cmd/cgo: package cmd/cgo: open /home/alexandru/source/
google_appengine/goroot/src/cmd/cgo: no such file or directory
$ find . -name 'cgo'
./goroot/src/pkg/runtime/cgo
./goroot/pkg/tool/linux_amd64/cgo

$ export GOARCH=amd64
$ export GOOS=linux
$ go get code.google.com/p/gorilla/sessions
load cmd/cgo: package cmd/cgo: open /home/alexandru/source/
google_appengine/goroot/src/cmd/cgo: no such file or directory

$ export GOOS=bogus
$ go get code.google.com/p/gorilla/sessions
go build runtime: exec: "/home/alexandru/source/google_appengine/
goroot/pkg/tool/linux_amd64/6g": stat /home/alexandru/source/
google_appengine/goroot/pkg/tool/linux_amd64/6g: no such file or
directory
$ find -name '6g'
./goroot/bin/6g
$ ln -s ../../../bin/6g goroot/pkg/tool/linux_amd64/6g

$ go get code.google.com/p/gorilla/sessions
# runtime
goroot/src/pkg/runtime/extern.go:135: undefined: theGoos
goroot/src/pkg/runtime/extern.go:135: cannot use theGoos as type
string in const initializer


Clearly I'm doing something wrong and I need some help to install
remote packages.

David Symonds

unread,
Apr 4, 2012, 8:03:04 PM4/4/12
to Alexandru Moșoi, golang-nuts
At the moment we don't have a good story for integrating the Go App
Engine SDK with the go tool. We hope to have one soon, but for now you
need to check out the package into your app's directory.

In Gorilla's case, the instructions at
http://code.google.com/p/gorilla/ should be sufficient (the "hg clone"
command).


Dave.

Reply all
Reply to author
Forward
0 new messages