Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
frederic89 opened this issue Oct 4, 2022 · 7 comments
Open

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

frederic89 opened this issue Oct 4, 2022 · 7 comments

Comments

@frederic89
Copy link

frederic89 commented Oct 4, 2022

按照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
Copy link
Author

换用了bazel3无以上报错

@frederic89
Copy link
Author

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

@zcdb
Copy link
Member

zcdb commented Nov 7, 2022

我们内部使用的3.4.1

@frederic89
Copy link
Author

jdk版本呢? 谢谢

@zcdb
Copy link
Member

zcdb commented Nov 10, 2022

jdk? 这不涉及jdk吧

@frederic89
Copy link
Author

jdk? 这不涉及jdk吧

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

@frederic89
Copy link
Author

frederic89 commented Nov 16, 2022

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants