protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.03k stars 15.42k forks source link

23.0: issue with generated protobuf.pc files (it depends on `utf8_range`) #12746

Closed kloczek closed 7 months ago

kloczek commented 1 year ago

Looks like generated protobuf.pc has in Requires utf8_range.

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 23.0.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
kloczek commented 1 year ago

Any update? 🤔

I just created ticket against libphonenumber https://issuetracker.google.com/issues/283987730

mkruskal-google commented 1 year ago

No, I'm waiting for you to provide the reproduction steps I asked for last week. I wasn't able to reproduce the issue you saw by guessing cmake flags.

kloczek commented 1 year ago

Cmake settings:

kloczek commented 1 year ago

libphonenumber maintainers just mentioned that they are observing as well linking issue https://issuetracker.google.com/issues/283987730#comment6

Romain-Geissler-1A commented 1 year ago

Hi,

FYI, on the main branch, the linking errors about thread_cache_ (and only this error, as this issue seems to mix several unrelated issues) should now be gone (for all non Windows users).

Note: I am not involved at all in Protobuf development, I am just an external contributor who hit this issue and decided to submit a fix for it ;)

Cheers, Romain

carlocab commented 1 year ago

Not sure what the status of this issue is, but here's some information that might be helpful. At Homebrew:

LazyPlanet commented 1 year ago

Linux centos also has error: /usr/local/include/google/protobuf/thread_safe_arena.h:198: undefined reference to google::protobuf::internal::ThreadSafeArena::thread_cache_' /usr/local/include/google/protobuf/thread_safe_arena.h:198: undefined reference togoogle::protobuf::internal::ThreadSafeArena::threadcache' /usr/local/include/google/protobuf/thread_safe_arena.h:198: undefined reference to `google::protobuf::internal::ThreadSafeArena::threadcache'

if message has repeated int32 or int64, i will get errors above, why?

image

while if message has repeated other type such as message or bytes, it build success...

Romain-Geissler-1A commented 11 months ago

My solution is define threadcache in my own source code(.pb.cc), like this⬇️.

Why not using up to date probotuf where this very problem is fixed already, without any hack required ?

github-actions[bot] commented 8 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] commented 7 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.