为什么 Bazel 的 rules_closure 下载平台特定的二进制文件而不是源代码?

Why does Bazel's rules_closure downloads platform specific binaries instead of sources?

我通过 filegroup_external 界面在 rules_closure repository (used by tensorflow when building it with //tensorflow/tools/pip_package:build_pip_package) that there are rules to build some dependencies like nodejs and protoc 上注意到了。

为什么不像其他依赖项那样从头开始构建它的原因是什么?

我问是因为这种方法会损害可移植性,因为它需要列出每个尝试构建 tensorflow 的平台的二进制文件(如果没有适合您的平台的二进制文件,情况会更糟)。

此构建配置确定性地工作,开箱即用,没有系统依赖性,在最新的 Linux/Mac/Windows 系统上使用 Intel CPU,并且不会产生额外的构建延迟。我们的目标是针对我们的支持矩阵中的内容进行优化以获得最佳构建体验。我同意你的看法,其他系统应该有一个逃生舱口。欢迎随时向 rules_closure 项目提出问题并抄送:@jart 以便我们可以讨论更多如何解决该问题。