3

I am using bazel to build my grpc proto3 and use the grpc-ecosystem/grpc-gateway in golang, but it failed due to missing symbol called without more detailed error message.

bazel build //proto/public/v1:admin_service_go_proto --sandbox_debug --verbose_failures with .bazelrc build --action_env=BAZEL_CXXOPTS="-std=c++20" I set the bazelrc because previously I have some errors mentioning the C++ versions less than C++14 are not supported.

Currently I am using mac 12.6.3, bazel 6.0.0, not sure what I am missing. I tried to search on github, but it seems like a weird issue, I am wondering whether it is related to macos.

Any idea would be very helpful.

Thanks!

ERROR: /private/var/tmp/_bazel_yingjiehe/3a8e1881b8ff4ae8cf3564b774e35dc9/external/com_google_protobuf/src/google/protobuf/BUILD.bazel:117:8: Executing genrule @com_google_protobuf//src/google/protobuf:gen_wkt_cc_sources [for tool] failed: (Aborted): sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_yingjiehe/3a8e1881b8ff4ae8cf3564b774e35dc9/sandbox/darwin-sandbox/1421/execroot/minerva_ai_admin_service && \
  exec env - \
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/yingjiehe/.web3j:/Users/yingjiehe/go/bin \
    TMPDIR=/var/folders/61/z8vsvfq51ks039hrrw_1z3nh0000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_yingjiehe/3a8e1881b8ff4ae8cf3564b774e35dc9/sandbox/darwin-sandbox/1421/sandbox.sb /var/tmp/_bazel_yingjiehe/install/b71f76217d6477ee63a36881fd643b1c/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_yingjiehe/3a8e1881b8ff4ae8cf3564b774e35dc9/sandbox/darwin-sandbox/1421/stats.out' /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; 
        bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/protoc_nowkt             --cpp_out=dllexport_decl=PROTOBUF_EXPORT:bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/wkt             --proto_path=$(dirname $(dirname $(dirname external/com_google_protobuf/src/google/protobuf/any.proto)))             external/com_google_protobuf/src/google/protobuf/any.proto external/com_google_protobuf/src/google/protobuf/api.proto external/com_google_protobuf/src/google/protobuf/duration.proto external/com_google_protobuf/src/google/protobuf/empty.proto external/com_google_protobuf/src/google/protobuf/field_mask.proto external/com_google_protobuf/src/google/protobuf/source_context.proto external/com_google_protobuf/src/google/protobuf/struct.proto external/com_google_protobuf/src/google/protobuf/timestamp.proto external/com_google_protobuf/src/google/protobuf/type.proto external/com_google_protobuf/src/google/protobuf/wrappers.proto
    ')
dyld[15189]: missing symbol called
/bin/bash: line 1: 15189 Abort trap: 6           bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/protoc_nowkt --cpp_out=dllexport_decl=PROTOBUF_EXPORT:bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/wkt --proto_path=$(dirname $(dirname $(dirname external/com_google_protobuf/src/google/protobuf/any.proto))) external/com_google_protobuf/src/google/protobuf/any.proto external/com_google_protobuf/src/google/protobuf/api.proto external/com_google_protobuf/src/google/protobuf/duration.proto external/com_google_protobuf/src/google/protobuf/empty.proto external/com_google_protobuf/src/google/protobuf/field_mask.proto external/com_google_protobuf/src/google/protobuf/source_context.proto external/com_google_protobuf/src/google/protobuf/struct.proto external/com_google_protobuf/src/google/protobuf/timestamp.proto external/com_google_protobuf/src/google/protobuf/type.proto external/com_google_protobuf/src/google/protobuf/wrappers.proto
Target //proto/public/v1:admin_service_proto failed to build

Here is the build rule and workspace

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2:defs.bzl", "protoc_gen_openapiv2")

proto_library(
    name = "admin_service_proto",
    srcs = [
        "admin_service.proto",
        "cluster.proto",
        "instance.proto",
    ],
    deps = [
        "@com_google_protobuf//:empty_proto",
        "@com_google_protobuf//:field_mask_proto",
        "@com_google_protobuf//:timestamp_proto",
        "@go_googleapis//google/api:annotations_proto",
    ],
)
workspace(name = "minerva_ai_admin_service")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

http_archive(
    name = "com_google_googletest",
    sha256 = "ffa17fbc5953900994e2deec164bb8949879ea09b411e07f215bfbb1f87f4632",
    strip_prefix = "googletest-1.13.0",
    urls = ["https://github.com/google/googletest/archive/v1.13.0.zip"],
)

http_archive(
    name = "com_google_protobuf",
    sha256 = "a1562006dbd31e79c12f944c359495807900a8b71f5bf0f6fa7741898259b2cd",
    strip_prefix = "protobuf-3.22.0",
    urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.22.0.tar.gz"],
)

http_archive(
    name = "rules_proto",
    sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1",
    strip_prefix = "rules_proto-4.0.0",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
        "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
    ],
)

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")

rules_proto_dependencies()

rules_proto_toolchains()

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
    ],
)

git_repository(
    name = "bazel_gazelle",
    commit = "f377e6eff8e24508feb1a34b1e5e681982482a9f",
    remote = "https://github.com/bazelbuild/bazel-gazelle",
    shallow_since = "1648046534 -0400",
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.19.4")

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

load("//:repositories.bzl", "go_repositories")

go_repositories()

gazelle_dependencies()

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

http_archive(
    name = "com_github_bazelbuild_buildtools",
    sha256 = "ca524d4df8c91838b9e80543832cf54d945e8045f6a2b9db1a1d02eec20e8b8c",
    strip_prefix = "buildtools-6.0.1",
    urls = ["https://github.com/bazelbuild/buildtools/archive/6.0.1.tar.gz"],
)

load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")

buildifier_dependencies()
Jay
  • 71
  • 3

0 Answers0