macos - 构建@com_google_protobuf 时缺少依赖项//:protobuf_lite

标签 macos protocol-buffers bazel

尝试构建时 :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/

相关文章:

Golang proto 文件管理和导入

go - 无法在 Go lang 中将 int32 protobuf 分配给 int

bazel - 有没有办法在 bazel 构建期间自动运行构建器?

python - 从源代码编译 Tensorflow 时出错 - 没有名为 'keras_applications' 的模块

c++ - 为什么我在 32 位 Mac OS X 系统上看到 C++ 中的 64 位指针?

objective-c - NSOutlineView : how to make parent items bold?

node.js - 解码后的时间戳与原始日期时间值不同

macos - 在OSX10.6上反汇编为x86_64(但使用_Intel_语法)

excel - 刷新 QueryTable 抛出 "General ODBC error"- VBA Excel 2011 for Mac

Bazel iOS 框架