尝试使用自定义工具链来构建依赖于 tensorflow 的目标,我的 CROSSTOOL 和工具链 BUILD 文件似乎很好。但是,在构建目标(取决于 tensorflow)时,出现以下错误:
>>>>>> #@org_tensorflow//tensorflow/core:version_lib [action 'Linking external/org_tensorflow/tensorflow/core/libversion_lib.a']
cd blah/blach && \ exec env - \ PWD=/proc/self/cwd \
path/to/linux-gnu-gcc-ar @bazel-out/local_linux-opt/bin/external/external/org_tensorflow/tensorflow/core/libversion_lib.a-2.params
错误在于“ar”本身的调用,它应该用文件的内容调用,而不是文件本身。
ERROR: path/to/tensorflow/core/BUILD:1033:1:1 Linking of rule
'@org_tensorflow//tensorflow/core:version_lib' failed: x86_64-unknown-linux-
gnu-gcc-ar failed: error executing command
(cd blah/blach && \ exec env - \ PWD=/proc/self/cwd \
path/to/linux-gnu-gcc-ar @bazel-out/local_linux-
opt/bin/external/external/org_tensorflow/tensorflow/core/libversion_lib.a-
2.params) : com.google.devtools.build.lib.shell.BadExitStatusException:
Process exited with status 1.
path/to/ar: invalid option --'@'
Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin
<name>] [member-name] [count] archive-file file... etc.
现在猫
bazel-out/local_linux/opt/bin/external/external/org_tensorflow/tensorflow/core/libversion_lib.a-2.params
我得到了'ar'的参数应该是什么,那就是我得到:
rcsD bazel-out/local_linux-opt/bin/external/org_tensorflow/tensorflow/core/libversion_lib.a bazel-out/local_linux-opt/bin/external/org_tensorflow/tensorflow/core/_objs/version_lib/external/org_tensorflow/tensorflow/core/util/version_info.o
应该运行的命令类似于:
path/to/custom/toolchain/ar $(cat bazel-out/local_linux/opt/bin/external/external/org_tensorflow/tensorflow/core/libversion_lib.a-2.params)
我错过了什么?我正在使用 bazel 的最新版本 0.5.2