我正在尝试为我的项目创建一个仅嵌入文件集合的 Bazel 规则。嵌入规则如下:
go_embed_data(
name = "my_files_go",
src = [
"embedded/src1", "embedded/src2"
],
package = "my_lib",
var = "myFiles",
)
然后我将其添加到我的 go_library 规则中:
go_library(
name = "library",
srcs = [
"library.go",
],
importpath = "github.com/nickfelker/golang-app",
deps = [
":my_files_go"
"//otherLib",
],
)
但是,当我尝试构建它时,我最终得到了一个在其他地方找不到的模糊错误。
Error: <target //library:my_files_go> (rule 'go_embed_data') doesn't contain declared provider 'GoArchive'
ERROR: Analysis of target '//:binary' failed; build aborted: Analysis of target '//library:library' failed
我应该如何解决这个错误?