Hi - I'm trying to get started on a new GRCP project written in C++. I'm using Bazel as a build tool. I'm using a bare-bones configuration and it's failing to build.
workspace(name = "myproj")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_github_grpc_grpc",
urls = [
],
strip_prefix = "grpc-635693ce624f3b3a89e5a764f0664958ef08b2b9",
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
BUILD
cc_binary(
name = "main",
srcs = [
"main.cpp",
],
defines = ["BAZEL_BUILD"],
deps = [
"@com_github_grpc_grpc//:grpc++",
],
)
Running bazel build :all produces the following error:
DEBUG: Rule 'com_github_grpc_grpc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "bd2ec83a5ed255950daa00e5c8a557a97b8ae20e530757c6c07ea4d78c846caa"
DEBUG: Repository com_github_grpc_grpc instantiated at:
/Users/albert.lockett2/Development/myproj/WORKSPACE:5:13: in <toplevel>
Repository rule http_archive defined at:
/private/var/tmp/_bazel_albert.lockett2/fdc77f09a5335393a1ec30d3d123ee8d/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Analyzed target //:main (1 packages loaded, 2 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_albert.lockett2/fdc77f09a5335393a1ec30d3d123ee8d/external/upb/upbc/BUILD:63:10: Compiling upbc/protoc-gen-upbdefs.cc [for host] failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 49 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/upb/upbc/protoc-gen-upbdefs.cc:31:
In file included from /usr/local/include/google/protobuf/descriptor.pb.h:24:
/usr/local/include/google/protobuf/arena.h:445:18: error: unused parameter 'p' [-Werror,-Wunused-parameter]
const T* p, std::false_type /*has_get_arena*/) {
^
1 error generated.
Target //:main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.117s, Critical Path: 2.92s
INFO: 55 processes: 47 internal, 8 darwin-sandbox.
FAILED: Build did NOT complete successfully
Does anyone have a working minimal grpc c++ setup using bazel that they'd be willing to share?