protocolbuffers/protobuf

Upgrading from 3.21.10 to 3.22.3 failures: missing symbol called

Open

#12.626 aperta il 1 mag 2023

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)C++ (16.128 fork)batch import
golanghelp wanted

Metriche repository

Star
 (71.223 star)
Metriche merge PR
 (Merge medio 2g 11h) (185 PR mergiate in 30 g)

Descrizione

What version of protobuf and what language are you using? Version: 3.22.3 Language: Go

What operating system (Linux, Windows, ...) and version? Mac OS

What runtime / compiler are you using (e.g., python version or gcc version) Bazel

What did you do?

  1. Upgrade com_google_protobuf from 3.21.10 to 3.22.3 in our WORKSPACE file
  2. Build the protos with bazel

What did you expect to see

Success after upgrading!

What did you see instead?

Build fails generating proto bindings for timestamp_proto:

ERROR: external/com_google_protobuf/src/google/protobuf/BUILD.bazel:64:14: Generating Descriptor Set proto_library @com_google_protobuf//src/google/protobuf:timestamp_proto failed: (Aborted): protoc failed: error executing command (from target @com_google_protobuf//src/google/protobuf:timestamp_proto) <SNIP>

<SNIP> --direct_dependencies google/protobuf/timestamp.proto '--direct_dependencies_violation_msg=%s is imported, but @com_google_protobuf//src/google/protobuf:timestamp_proto doesn'\''t directly depend on a proto_library that '\''srcs'\'' it.' '--descriptor_set_out=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src/google/protobuf/timestamp_proto-descriptor-set.proto.bin' '--proto_path=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src/google/protobuf/_virtual_imports/timestamp_proto' '-Igoogle/protobuf/timestamp.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src/google/protobuf/_virtual_imports/timestamp_proto/google/protobuf/timestamp.proto' bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src/google/protobuf/_virtual_imports/timestamp_proto/google/protobuf/timestamp.proto)

# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
dyld[57868]: missing symbol called

Note: in addition to the timestamp proto, which I actually depend on, other protos suffer the same fate. The failed proto changes randomly every build. @com_google_protobuf//src/google/protobuf:wrappers_proto, for example, hits the same issue, but it's not a dependency of any of my rules.

Environment

Rules:

proto_library(
    name = "my_proto",
    srcs = [
        "my_proto.proto",
        "my_proto_other.proto",
    ],
)


go_proto_library(
    name = "my_go_proto",
    # io_bazel_rules version v0.39.1 and rules_proto-5.3.0-21.7
    compilers = ["@io_bazel_rules_go//proto:go_grpc"],
    importpath = "github.com/example_repo/go/proto/package",
    proto = ":my_proto",
)

proto:

syntax = "proto3";
package proto;

import "google/protobuf/timestamp.proto";

option go_package = "github.com/example_repo/go/proto/package";
message SomeMessage {
  google.protobuf.Timestamp ts = 2;
}

Guida contributor