dongxin1999 2017-10-20 08: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 08:51
    关注

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

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

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

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵