尝试构建时 :protoc
在 OS X 上来自 https://github.com/google/protobuf/ (3.4.1 版本)我得到以下信息:
$ 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'.
```
但是,当构建目标而不是作为外部存储库时,它会成功。
$ cd <...>/external/com_google_protobuf/
$ bazel build :protobuf_lite
列出的标题是系统标题,所以我遗漏了一些非常明显的内容。
有任何想法吗?
最佳答案
来自 https://github.com/bazelbuild/bazel/issues/2852#issuecomment-295747929 :
设置 BAZEL_SH=/bin/bash
解决了这个问题。
关于macos - 构建@com_google_protobuf 时缺少依赖项//:protobuf_lite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46614261/