У меня возникают проблемы со сборкой Bazel, когда я пытаюсь создать googleapis texttospeech_proto и speech_proto с помощью сервиса gRP C. В каталоге root моего проекта я получаю следующую ошибку:
ERROR: <>/BUILD:42:1: output 'external/com_google_googleapis/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.h' was not created
ERROR: <>/BUILD:42:1: output 'external/com_google_googleapis/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.cc' was not created
ERROR: <>/BUILD:42:1: not all outputs were created or valid
Мои BUILD
/ WORKSPACE
файлы находятся ниже:
BUILD
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
cc_proto_library(
name = "speech_cc_proto",
deps = [
"@com_google_googleapis//google/cloud/speech/v1p1beta1:speech_proto",
],
visibility = ["//visibility:public"],
)
cc_grpc_library(
name = "cloud_speech_grpc",
srcs = [
"@com_google_googleapis//google/cloud/speech/v1p1beta1:speech_proto",
],
deps = [
":speech_cc_proto",
],
grpc_only = 1,
use_external = 1,
visibility = ["//visibility:public"],
)
cc_proto_library(
name = "texttospeech_cc_proto",
deps = [
"@com_google_googleapis//google/cloud/texttospeech/v1:texttospeech_proto",
],
visibility = ["//visibility:public"],
)
cc_grpc_library(
name = "cloud_texttospeech_grpc",
srcs = [
"@com_google_googleapis//google/cloud/texttospeech/v1:texttospeech_proto",
],
deps = [
":texttospeech_cc_proto",
],
grpc_only = 1,
use_external = 1,
visibility = ["//visibility:public"],
)
РАБОЧЕЕ МЕСТО
git_repository(
name = "com_github_grpc_grpc",
remote = "https://github.com/grpc/grpc.git",
tag = "v1.27.0-pre1",
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
load("@io_bazel_rules_python//python:pip.bzl", "pip_import", "pip_repositories")
pip_import(
name = "grpc_python_dependencies",
requirements = "@com_github_grpc_grpc//:requirements.bazel.txt",
)
load("@grpc_python_dependencies//:requirements.bzl", "pip_install")
pip_repositories()
pip_install()
git_repository(
name = "com_google_googleapis",
remote = "https://github.com/googleapis/googleapis.git",
commit = "3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19",
)
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
grpc = True,
)
Если я переместил свой файл BUILD
из рабочего пространства root (в дочернее рабочее пространство / папку), я получу другую ошибку, сообщающую cloud_speech.proto
/ cloud_tts.proto
файлы не находятся в дочерней рабочей области.