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

图片转代码服务由CSDN问答提供 功能建议

我正在从包含更多项目的GOPATH部署Google App Engine应用。 由于某种原因,正在编译的库(github.com/mattn/go-sqlite3)没有从我正在上载的应用程序中引用,并且失败了。</ p>

从gcloud排除代码树不必要部分的方法? 在gcloud的文档中找不到有关如何执行此操作的任何信息。</ p>

 更新服务[默认] ... 
 ....失败。  
错误:(gcloud.app.deploy)错误响应:[9]部署包含无法编译的文件:编译失败:
2017 / 10/20 01:30:38 go-app-builder:构建时间:12×编译 (总计2.234秒),0×链接(总计0秒)
2017 / 10/20 01:30:38 go-app-builder:运行编译失败:退出状态2 
 
github.com/mattn/go-sqlite3/  sqlite3_go18.go:18:未定义:SQLiteConn 
github.com/mattn/go-sqlite3/sqlite3_go18.go:26:未定义:SQLiteConn 
github.com/mattn/go-sqlite3/sqlite3_go18.go:27:未定义:namedValue \  ngithub.com/mattn/go-sqlite3/sqlite3_go18.go:29:未定义:namedValue 
github.com/mattn/go-sqlite3/sqlite3_go18.go:35:未定义:SQLiteConn 
github.com/mattn/go-sqlite3/  sqlite3_go18.go:36:未定义:namedValue 
github.com/mattn/go-sqlite3/sqlite3_go18.go:44:未定义:SQLiteConn 
github.com/mattn/go-sqlite3/sqlite3_go18.go:49:未定义:SQLiteConn \  ngith  ub.com/mattn/go-sqlite3/sqlite3_go18.go:54:未定义:SQLiteStmt 
github.com/mattn/go-sqlite3/sqlite3_go18.go:63:未定义:SQLiteStmt 
github.com/mattn/go-sqlite3/  sqlite3_go18.go:36:错误太多
 </ code> </ pre> 
 
 

这似乎最近已更改,我尚未更改我的应用程序以要求使用此库,而我正在努力 不会更改任何其他代码的分支。 我能想到的唯一的另一件事是,我去获取google.golang.org/appengine </ code>,因为该库如果供应商将无法正常工作。 但是,我在其源代码树中也找不到对sqlite3的任何引用。</ p>

  $ 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 
 </ code> </ pre>  
 </ div>

1条回答 默认 最新

相关推荐 更多相似问题