构建错误:使用 bazel 从源代码构建时出现未知警告组“-Wdeprecated-enum-enum-conversion”

问题描述 投票:0回答:1

我按照grpc构建说明使用bazel,在步骤

bazel build :all
之后,我得到了如下所示的错误

ERROR: /home/username/.cache/bazel/_bazel_username/36f83adb686bb580874d961cfbeaeeac/external/com_google_protobuf/src/google/protobuf/compiler/BUILD.bazel:104:11: Compiling src/google/protobuf/compiler/main.cc [for tool] failed: (Exit 1): clang failed: error executing command (from target @com_google_protobuf//src/google/protobuf/compiler:protoc_lib) /usr/lib/llvm-6.0/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 92 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:32:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/_virtual_includes/command_line_interface/google/protobuf/compiler/command_line_interface.h:52:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/port.h:53:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:32:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/_virtual_includes/command_line_interface/google/protobuf/compiler/command_line_interface.h:55:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:33:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/cpp/_virtual_includes/cpp/google/protobuf/compiler/cpp/generator.h:43:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/_virtual_includes/code_generator/google/protobuf/compiler/code_generator.h:49:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:33:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/cpp/_virtual_includes/cpp/google/protobuf/compiler/cpp/generator.h:46:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:34:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/csharp/_virtual_includes/csharp/google/protobuf/compiler/csharp/csharp_generator.h:40:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:35:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/java/_virtual_includes/java/google/protobuf/compiler/java/generator.h:45:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:36:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/java/_virtual_includes/java/google/protobuf/compiler/java/kotlin_generator.h:41:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:37:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/objectivec/_virtual_includes/objectivec/google/protobuf/compiler/objectivec/generator.h:40:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.h:64:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/stubs/_virtual_includes/lite/google/protobuf/stubs/common.h:46:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/stubs/_virtual_includes/lite/google/protobuf/stubs/port.h:45:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:37:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/objectivec/_virtual_includes/objectivec/google/protobuf/compiler/objectivec/generator.h:40:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.h:64:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/stubs/_virtual_includes/lite/google/protobuf/stubs/common.h:56:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:37:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/objectivec/_virtual_includes/objectivec/google/protobuf/compiler/objectivec/generator.h:40:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.h:78:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:37:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/objectivec/_virtual_includes/objectivec/google/protobuf/compiler/objectivec/generator.h:43:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:38:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/php/_virtual_includes/php/google/protobuf/compiler/php/php_generator.h:35:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/php/_virtual_includes/names/google/protobuf/compiler/php/names.h:39:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:38:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/php/_virtual_includes/php/google/protobuf/compiler/php/php_generator.h:40:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:39:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/python/_virtual_includes/python/google/protobuf/compiler/python/generator.h:44:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.pb.h:11:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:39:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/python/_virtual_includes/python/google/protobuf/compiler/python/generator.h:44:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.pb.h:24:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/io/_virtual_includes/io/google/protobuf/io/coded_stream.h:140:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:39:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/python/_virtual_includes/python/google/protobuf/compiler/python/generator.h:44:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.pb.h:25:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/arena.h:52:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena_align/google/protobuf/arena_align.h:85:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:39:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/python/_virtual_includes/python/google/protobuf/compiler/python/generator.h:44:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.pb.h:25:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/arena.h:53:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena/google/protobuf/arena_config.h:38:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:39:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/python/_virtual_includes/python/google/protobuf/compiler/python/generator.h:44:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.pb.h:25:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/arena.h:55:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/serial_arena.h:49:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena_cleanup/google/protobuf/arena_cleanup.h:46:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
In file included from external/com_google_protobuf/src/google/protobuf/compiler/main.cc:39:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/python/_virtual_includes/python/google/protobuf/compiler/python/generator.h:44:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_nowkt/google/protobuf/descriptor.pb.h:25:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/arena.h:55:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/serial_arena.h:51:
In file included from bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/arenaz_sampler.h:42:
bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/port_def/google/protobuf/port_def.inc:1009:32: error: unknown warning group '-Wdeprecated-enum-enum-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
                               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
INFO: Elapsed time: 25.637s, Critical Path: 5.23s
INFO: 219 processes: 219 internal.
FAILED: Build did NOT complete successfully

操作系统:Ubuntu 18.04(在 VirtualBox 7.0 上)

gcc版本:gcc(Ubuntu 7.5.0-3ubuntu1~18.04)7.5.0

clang版本:clang版本6.0.0-1ubuntu2(tags/RELEASE_600/final)

--

我不知道如何解决它。有什么我错过的吗?

我希望它的构建不会出现错误。谢谢。

grpc
1个回答
0
投票

我在 Ubuntu 18.04 中遇到了同样的问题,但是 grpc 存档有很多发行版本(gitbranch --all),所以我决定为我的编译器找到最新版本(gcc --version 对我来说有 7.5.0),我做了以下步骤:

git clone https://github.com/grpc/grpc.git
cd grpc
git checkout v1.54.x
git submodule update --init
bazel build :all

对于 protobuf,您可以单独检查它,因为我认为 grpc 仅使用来自 protobuf 的有效负载。现在我使用 protobuf 26.0 版本,在 Ubuntu 18.04 中完美运行。

© www.soinside.com 2019 - 2024. All rights reserved.