nafmo
nafmo

Reputation: 508

gcloud app deploy tries to compile unwanted files, can I exclude parts of the tree?

I am deploying a Google App Engine app from a GOPATH that contains more projects. For some reason, a vendored library (github.com/mattn/go-sqlite3) that is not referenced from the application that I am uploading is being compiled, and fails.

Is there a way to exclude the unnecessary parts of the code tree from gcloud? I can't find anything in the documentation for gcloud on how to do that.

Updating service [default]...
.......failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed:
2017/10/20 01:30:38 go-app-builder: build timing: 12×compile (2.234s total), 0×link (0s total)
2017/10/20 01:30:38 go-app-builder: failed running compile: exit status 2

github.com/mattn/go-sqlite3/sqlite3_go18.go:18: undefined: SQLiteConn
github.com/mattn/go-sqlite3/sqlite3_go18.go:26: undefined: SQLiteConn
github.com/mattn/go-sqlite3/sqlite3_go18.go:27: undefined: namedValue
github.com/mattn/go-sqlite3/sqlite3_go18.go:29: undefined: namedValue
github.com/mattn/go-sqlite3/sqlite3_go18.go:35: undefined: SQLiteConn
github.com/mattn/go-sqlite3/sqlite3_go18.go:36: undefined: namedValue
github.com/mattn/go-sqlite3/sqlite3_go18.go:44: undefined: SQLiteConn
github.com/mattn/go-sqlite3/sqlite3_go18.go:49: undefined: SQLiteConn
github.com/mattn/go-sqlite3/sqlite3_go18.go:54: undefined: SQLiteStmt
github.com/mattn/go-sqlite3/sqlite3_go18.go:63: undefined: SQLiteStmt
github.com/mattn/go-sqlite3/sqlite3_go18.go:36: too many errors

This seems to have changed recently, I haven't changed my app to require this library, and I am working on a branch that does not change any other code. The only other thing I can think of is that I do go get google.golang.org/appengine since that library doesn't work if vendored. I can't find any references to sqlite3 in its source tree either, however.

$ gcloud --version
Google Cloud SDK 175.0.0
alpha 2017.10.09
app-engine-go 
app-engine-python 1.9.61
beta 2017.10.09
bq 2.0.27
cloud-datastore-emulator 1.2.1
core 2017.10.09
gsutil 4.27

Upvotes: 0

Views: 216

Answers (1)

Alexander Trakhimenok
Alexander Trakhimenok

Reputation: 6278

Try to add the folder to skip_files: section into app.yaml

https://cloud.google.com/appengine/docs/standard/go/config/appref

Upvotes: 1

Related Questions