dongxin1999 2017-10-20 00:41
浏览 39
已采纳

gcloud app deploy尝试编译不需要的文件,我可以排除树的一部分吗?

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

展开全部

  • 写回答

1条回答 默认 最新

  • doww38701 2017-10-20 00:51
    关注

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

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部