Skip to content

Instantly share code, notes, and snippets.

@dsoprea
Created August 2, 2016 15:24
Show Gist options
  • Save dsoprea/930ca5123ce148d3f58c0c4dd75a788d to your computer and use it in GitHub Desktop.
Save dsoprea/930ca5123ce148d3f58c0c4dd75a788d to your computer and use it in GitHub Desktop.
Importing fully-qualified "appengine" package causes unsafe/syscall errors
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
apt-get update
apt-get install -y unzip git
wget -nv https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.40.zip
unzip go_appengine_sdk_linux_amd64-1.9.40.zip
mkdir testproject
cd testproject
cat << EOF > app.yaml
application: testapp
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
EOF
cat << EOF > main.go
package testapp
import (
"log"
"google.golang.org/appengine"
// "appengine"
)
func init() {
log.Print(appengine.IsDevAppServer())
}
func main() {
// This is only here because go-get needs on it.
}
EOF
GOPATH=`pwd` ../go_appengine/goapp get
#GOPATH=`pwd` ../go_appengine/goapp serve
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "shell", inline: $script
end
# Run "GOPATH=`pwd` ../go_appengine/goapp serve" inside.
#
# Produces error (may not produce the same one every time):
#
# 2016/08/02 15:20:28 go-app-builder: Failed parsing input: parser: bad import "syscall" in src/golang.org/x/net/ipv4/dgramopt_posix.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment