Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf should inherit dependency #1386

Open
v-for-vandal opened this issue Feb 2, 2024 · 2 comments
Open

protobuf should inherit dependency #1386

v-for-vandal opened this issue Feb 2, 2024 · 2 comments

Comments

@v-for-vandal
Copy link
Contributor

When building protobuf and abseil from wrapdb, and then compiling generated code, one can encounter an error:
clang++ -stdlib=libc++ -Iproto/libhs_proto_lib.a.p -Iproto -I../proto -Isubprojects/protobuf-25.2/src -I../subprojects/protobuf-25.2/src -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++20 -O0 -g -stdlib=libc++ -fexperimental-library -pedantic -fPIC -MD -MQ proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o -MF proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o.d -o proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o -c proto/libhs_proto_lib.a.p/city/improvements.pb.cc In file included from proto/libhs_proto_lib.a.p/city/improvements.pb.cc:4: In file included from proto/libhs_proto_lib.a.p/city/improvements.pb.h:26: ../subprojects/protobuf-25.2/src/google/protobuf/io/coded_stream.h:109:10: fatal error: 'absl/log/absl_check.h' file not found #include "absl/log/absl_check.h" ^~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
The reason for this error is that protobuf headers require abseil and protobuf marks abseil as dependency. However, this dependency is not forwarded to the users of protobuf dep. Protobuf can build itself without problems, but when my file includes coded_stream.h it can't find abseil headers.

I think you should add here: https://github.com/mesonbuild/wrapdb/blob/master/subprojects/packagefiles/protobuf/meson.build#L217
a line
dependencies: deps,

variable deps contains abseil dependencies and this way those abseil deps will be forwarded to protobuf users.

I checked this fix in my repo.

@neheb
Copy link
Collaborator

neheb commented Feb 2, 2024

Sounds correct. I believe upstream bundles their own copy of abseil instead of using the actual package.

@v-for-vandal
Copy link
Contributor Author

#1391

Here is PR + option to disable install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants