gamma icon indicating copy to clipboard operation
gamma copied to clipboard

编译Gamma的第三方软件scann-1.2.1时报错

Open frederic89 opened this issue 2 years ago • 7 comments

按照vearch和gamma编译说明和编译脚本,当运行到用bazel编译scann-1.2.1时出现如下报错,都指向com_google_protobuf这个内容:

ERROR: /root/.cache/bazel/_bazel_root/7125299c24cb2d7bde318ecca9ed5091/external/com_google_protobuf/BUILD:979:21: in proto_lang_toolchain rule @com_google_protobuf//:cc_toolchain: '@com_google_protobuf//:cc_toolchain' does not have mandatory provider 'ProtoInfo'. ERROR: Analysis of target '//:build_pip_pkg' failed; build aborted: Analysis of target '@com_google_protobuf//:cc_toolchain' failed INFO: Elapsed time: 0.270s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf
igured)

我试了这个网文的方法(https://zhuanlan.zhihu.com/p/488199658) #bazel版本过高的话,会有如下错误: in proto_lang_toolchain rule @com_google_protobuf//:cc_toolchain: '@com_google_protobuf//:cc_toolchain' does not have mandatory provider 'ProtoInfo'. 可以加以下参数解决: bazel build ... --incompatible_blacklisted_protos_requires_proto_info=false 还是也不能修复编译问题,是不是WORKSPACE里的 https://github.com/bazelbuild/rules_cc 的版本或者com_google_protobuf使用github的tag版本有问题,也有网文说要修改类似内容的。我试验了改了这俩个几个版本,在bazel编译时还是出现failed ERROR。

Centos 7 ( MacOS Big Sur + 2.7 GHz 双核Intel Core i5 + Parallels Desktop) + bazel 4 + gcc 9.3.1+ clang 8

  1. gcc 9 是利用了devtoolset-9安装的,环境通过source /opt/rh/devtoolset-9/enable激活
  2. clang llvm8编译安装,PATH:/usr/local/clang/bin
  3. Bazel 4 安装使用了: wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.rep --no-check-certificate mv vbatts-bazel-epel-7.rep /etc/yum.repos.d/ cd /etc/yum.repos.d mv vbatts-bazel-epel-7.rep vbatts-bazel-epel-7.repo yum install -y bazel4

frederic89 avatar Oct 04 '22 13:10 frederic89

换用了bazel3无以上报错

frederic89 avatar Oct 30 '22 11:10 frederic89

请问可以Pass的bazel编译版本是多少?

frederic89 avatar Nov 05 '22 23:11 frederic89

我们内部使用的3.4.1

zcdb avatar Nov 07 '22 03:11 zcdb

jdk版本呢? 谢谢

frederic89 avatar Nov 10 '22 05:11 frederic89

jdk? 这不涉及jdk吧

zcdb avatar Nov 10 '22 06:11 zcdb

jdk? 这不涉及jdk吧

我手动装bazel 我看bazel需要安装对应版本的openjdk才能使用成功 查了下 好像bazel3不能用openjdk-8 https://blog.csdn.net/weixin_44278403/article/details/107449795 所以才来问一下咯

frederic89 avatar Nov 10 '22 06:11 frederic89

bazel 3.4.1 + openjdk-11 + gcc 9.4(编译安装) + clang-8 环境编译scann不通过报错: 请再指教 @zcdb (bazel 3.4.1 安装自 https://mirrors.huaweicloud.com/bazel/3.4.1/bazel-3.4.1-installer-linux-x86_64.sh openjdk 安装自yum install) (gcc+clang 在env的中配置 echo "export CC=clang" >> /etc/bashrc # echo "export CC=/usr/bin/gcc" >> /etc/bashrc echo "export CXX=clang++" >> /etc/bashrc echo "export PATH=$PATH:/usr/local/clang/bin" >> /etc/bashrc)

Extracting Bazel installation... Starting local Bazel server and connecting to it... Loading: Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Analyzing: target //:build_pip_pkg (1 packages loaded, 0 targets configured) Analyzing: target //:build_pip_pkg (6 packages loaded, 5 targets configured) Analyzing: target //:build_pip_pkg (6 packages loaded, 5 targets configured) Analyzing: target //:build_pip_pkg (6 packages loaded, 5 targets configured) INFO: Repository local_config_cc instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule cc_autoconf defined at: /root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/cc_configure.bzl:143:30: in ERROR: An error occurred during the fetch of repository 'local_config_cc': Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/cc_configure.bzl", line 125 configure_unix_toolchain(<3 more arguments>) File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 352, in configure_unix_toolchain _find_generic(repository_ctx, <3 more arguments>) File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 322, in _find_generic auto_configure_fail(msg) File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, in auto_configure_fail fail(<1 more arguments>)

Auto-Configuration Error: Cannot find gcc or CC (clang); either correct your path or set the CC environment variable ERROR: /root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/src/tools/launcher/BUILD:9:14: @bazel_tools//src/tools/launcher:launcher depends on @local_config_cc//:cc-compiler-k8 in repository @local_config_cc which failed to fetch. no such package '@local_config_cc//': Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/cc_configure.bzl", line 125 configure_unix_toolchain(<3 more arguments>) File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 352, in configure_unix_toolchain _find_generic(repository_ctx, <3 more arguments>) File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/unix_cc_configure.bzl", line 322, in _find_generic auto_configure_fail(msg) File "/root/.cache/bazel/_bazel_root/1fd1b682e65630d5ac25a25ae95f5b5c/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, in auto_configure_fail fail(<1 more arguments>)

Auto-Configuration Error: Cannot find gcc or CC (clang); either correct your path or set the CC environment variable ERROR: Analysis of target '//:build_pip_pkg' failed; build aborted: Analysis failed INFO: Elapsed time: 138.537s INFO: 0 processes. FAILED: Build did NOT complete successfully (20 packages loaded, 59 targets configured) FAILED: Build did NOT complete successfully (20 packages loaded, 59 targets configured) scann bazel build error -- SCANN BUILD ERROR, EXEC_RET_VAL=2 CMake Error at CMakeLists.txt:233 (EXIT): Unknown CMake command "EXIT".

frederic89 avatar Nov 16 '22 05:11 frederic89