Macos 构建@com\u google\u protobuf/:protobuf\u lite时缺少依赖项

Macos 构建@com\u google\u protobuf/:protobuf\u lite时缺少依赖项,macos,protocol-buffers,bazel,Macos,Protocol Buffers,Bazel,当尝试从(3.4.1版本)在OS X上构建:protoc时,我得到以下信息: $ bazel build @com_google_protobuf//:protobuf_lite ERROR: <...>/external/com_google_protobuf/BUILD:93:1: undeclared inclusion(s) in rule '@com_google_protobuf//:protobuf_lite': this rule is missing depend

当尝试从(3.4.1版本)在OS X上构建
:protoc
时,我得到以下信息:

$ bazel build @com_google_protobuf//:protobuf_lite

ERROR: <...>/external/com_google_protobuf/BUILD:93:1: undeclared inclusion(s) in rule '@com_google_protobuf//:protobuf_lite':
this rule is missing dependency declarations for the following files included by 'external/com_google_protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc':
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/stddef.h'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/__stddef_max_align_t.h'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/stdint.h'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/stdarg.h'
  '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/limits.h'.
```
$bazel build@com\u google\u protobuf/:protobuf\u lite
错误:/external/com\u google\u protobuf/BUILD:93:1:规则'@com\u google\u protobuf//:protobuf\u lite'中未声明的包含项:
“external/com\u google\u protobuf/src/google/protobuf/io/zero\u copy\u stream\u impl\u lite.cc”包含的以下文件缺少依赖项声明:
“/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/lib/clang/8.1.0/include/stddef.h”
“/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/lib/clang/8.1.0/include/uu stddef\u max\u align\u t.h”
“/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/lib/clang/8.1.0/include/stdint.h”
“/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/lib/clang/8.1.0/include/stdarg.h”
“/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/lib/clang/8.1.0/include/limits.h”。
```
但是,当建立目标而不是作为外部回购时,它成功了

$ cd <...>/external/com_google_protobuf/
$ bazel build :protobuf_lite
$cd/external/com\u google\u protobuf/
$bazel构建:protobuf_lite
列出的标题是系统标题,因此我遗漏了一些非常明显的内容

有什么想法吗?

来自:


设置
BAZEL_SH=/bin/bash
解决了这个问题。

FWIW在升级MacOS命令行工具后,我今天遇到了同样的错误

对我起作用的是
bazel clean--expunge
。没有——删除它并不能解决问题