Skip to content

Instantly share code, notes, and snippets.

@mbland
Last active August 28, 2024 19:23
Show Gist options
  • Save mbland/f6d91ac30b074e16b76686d15ee4919d to your computer and use it in GitHub Desktop.
Save mbland/f6d91ac30b074e16b76686d15ee4919d to your computer and use it in GitHub Desktop.
Reproduce grpc/grpc#37251

Reproduction of grpc/grpc#37251

Reproduced using a local grpc/grpc repo checked out at tag v1.66.0 after applying the matching bazel-central-registry patches.

Fixed in grpc module version 1.66.0.bcr.1 by bazelbuild/bazel-central-registry: grpc 1.66.0: Add current_py_cc_libs to pyx_library #2685.

$ bazel build //...

[ ...snip... ]

ERROR: .../external/grpc~/src/python/grpcio/grpc/_cython/BUILD.bazel:25:12:
  Linking external/grpc~/src/python/grpcio/grpc/_cython/cygrpc.so failed:
  (Exit 1): cc_wrapper.sh failed: error executing CppLink command
    (from target @@grpc~//src/python/grpcio/grpc/_cython:cygrpc.so)
      external/bazel_tools~cc_configure_extension~local_config_cc/cc_wrapper.sh
      @bazel-out/darwin_arm64-fastbuild/bin/external/grpc~/src/python/grpcio/grpc/_cython/cygrpc.so-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Undefined symbols for architecture arm64:
  "_PyArg_UnpackTuple", referenced from:
      __Pyx_Coroutine_Throw(_object*, _object*) in cygrpc.o
      __Pyx_async_gen_athrow_send(__pyx_PyAsyncGenAThrow*, _object*) in cygrpc.o
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("@grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
proto_library(
name = "example_proto",
srcs = ["example.proto"],
)
py_proto_library(
name = "example_py_proto",
deps = [":example_proto"],
)
py_grpc_library(
name = "example_py_grpc",
srcs = [":example_proto"],
deps = [":example_py_proto"],
)
syntax = "proto3";
package grpc37251;
message ExampleRequest {}
message ExampleResponse {}
service ExampleService {
rpc GetExample (ExampleRequest) returns (ExampleResponse) {}
}
"""Reproduction of grpc/grpc#37251"""
module(name = "grpc-37251", version = "0.0.0")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "protobuf", version = "28.0-rc2")
bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "rules_python", version = "0.35.0")
# Change the version back to "1.66.0" to see the original failure.
bazel_dep(name = "grpc", version = "1.66.0.bcr.1")
# Used following to create the fix in a local grpc repository.
#local_path_override(module_name = "grpc", path = "../grpc")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment